クラスがあり、値が0、1、3、7、15、...のビットマスクが必要です。
したがって、基本的に、次のような定数intの配列を宣言したいと思います。
class A{
const int masks[] = {0,1,3,5,7,....}
}
しかし、コンパイラは常に文句を言います。
私は試した:
static const int masks[] = {0,1...}
static const int masks[9]; // then initializing inside the constructor
これをどのように行うことができるかについてのアイデアはありますか?
ありがとう!