首页 > 解决方案 > 如何在标头(C++)中声明数据结构的大小

问题描述

我想在标题中声明我的循环缓冲区的大小,但我不知道如何。如果我用数字替换 BUFFER_SIZE,它会给我错误expected a type specifier

ofApp.h

#pragma once

#include "ofMain.h"
#include <boost/circular_buffer.hpp>

class ofApp : public ofBaseApp{

    public:

        boost::circular_buffer<Element> cb(BUFFER_SIZE);

};

标签: c++boostopenframeworks

解决方案


推荐阅读