编译器错误 C2272

“function”:静态成员函数上不允许使用修饰符

static 成员函数使用内存模型说明符(例如 constvolatile)进行声明,并且 static 成员函数上不允许使用此类修饰符。

以下示例生成 C2272:

// C2272.cpp
// compile with: /c
class CMyClass {
public:
   static void func1() const volatile;   // C2272  func1 is static
   void func2() const volatile;   // OK
};