有人告诉我,由于C ++ 11的变化,以下内容是可能的:
class SomeType {
int number;
public:
SomeType(int new_number) : number(new_number) {}
SomeType() : SomeType(42) {}
};
但是当我尝试构建时,我收到错误:
"SomeType" is not a nonstatic data member or base class of class "SomeType"
error C2614: 'SomeType' : illegal member initialization: 'SomeType' is not a base or member
Visual Studio 2010中是否尚不支持此功能?我是否需要配置一些东西来构建它?有什么问题?