use*_*967 6 c++ constructor visual-studio-2010 visual-c++ c++11
有人告诉我,由于C++ 11的变化,以下内容是可能的:
class SomeType {
int number;
public:
SomeType(int new_number) : number(new_number) {}
SomeType() : SomeType(42) {}
};
Run Code Online (Sandbox Code Playgroud)
但是当我尝试构建时,我收到一个错误:
"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
Run Code Online (Sandbox Code Playgroud)
Visual Studio 2010中是否还不支持此功能?我是否需要配置一些东西来构建它?怎么了?
Dav*_*vid 10
VS2010不支持它.VS2010(或VS11)不支持大多数C++ 11功能
以下是VC10和VC11中支持的功能的图表.
| 归档时间: |
|
| 查看次数: |
1486 次 |
| 最近记录: |