编译器错误 C2650

“operator”:不能是虚拟函数

newdelete 运算符被声明为 virtual。 这些运算符是 static 成员函数,不能是 virtual

示例

下面的示例生成 C2650:

// C2650.cpp
// compile with: /c
class A {
   virtual void* operator new( unsigned int );   // C2650
   // try the following line instead
   // void* operator new( unsigned int );
};