标签: c++ class initialization
我已经写了以下内容,并期望a使用4 rvalue进行初始化。但它没有:
a
4
struct A { const int a; A() //ctor-initializer is not specified, therefore no initialization for a is performed { a = 4; //initialization } }; A a;
出了什么问题?为什么编译器会抱怨?