1. error C2864: “OuterClass::m_outerInt”: 只有静态常量整型数据成员才可以在类中初始化
class OuterClass { public: OuterClass() { m_outerInt = 10; } private: int m_outerInt = 0;//这里报错
C++11 之前的标准
只有静态常量整型数据成员,才可以在类中初始化。
2.
时间: 2024-07-29 23:01:08
1. error C2864: “OuterClass::m_outerInt”: 只有静态常量整型数据成员才可以在类中初始化
class OuterClass { public: OuterClass() { m_outerInt = 10; } private: int m_outerInt = 0;//这里报错
C++11 之前的标准
只有静态常量整型数据成员,才可以在类中初始化。
2.