会员
周边
新闻
博问
AI培训
云市场
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
adfas
博客园
首页
新随笔
联系
订阅
管理
2020年7月15日
enum hack
摘要: 在C++11之前,不支持static const member declaration,即在声明static const对象的同时进行赋值(只适用于内置类型?)。如果需要在class内部定义个数组,但是又需要定义一个数组常量,可以使用enum hack: class foo { private: e
阅读全文
posted @ 2020-07-15 09:06 adfas
阅读(158)
评论(0)
推荐(0)
编辑
公告