编译器错误 C2583

'identifier':'const/volatile' 'this' 指针对于构造函数/析构函数是非法的

注解

构造函数析构函数不能声明为 constvolatile

示例:

以下示例生成 C2583:

// C2583.cpp
// compile with: /c
struct S
{
    S() const {}   // C2583

    // Try the following line instead:
    // S() {}
};