c++ - 如何在标头(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);
};
解决方案
推荐阅读
- javascript - 禁用日语的自动完成功能
- sql - 如何查询两个日期之间未访问的对象(数据库、表)?
- typescript - 更漂亮的忽略一行代码不起作用?JSX -- {/* prettier-ignore */}
- javascript - 我需要帮助弄清楚如何添加值
- java - 连接互联网并关闭 apk 一段时间后显示弹出窗口
- react-native - 导航屏幕时,BottomTabNavigator 内的 StackNavigator 被重新渲染
- django - 甚至可以过滤 JsonField 元组或列表吗?(过滤仅适用于字典?)
- excel - Sendkeys 工作簿 vba
- c++ - 以下命令是什么“typedef mpc_val_t*(*mpc_apply_t)(mpc_val_t*);”
- python - 如何在有向树图中找到度数> 2的顶点之间的路径?