编译器错误 C2824
“operator new”的返回类型必须为“void *”
对于非基指针,运算符 new
的重载必须返回 void *
。
以下示例生成 C2824:
// C2824.cpp
// compile with: /c
class A {
A* operator new(size_t i, char *m); // C2824
// try the following line instead
// void* operator new(size_t i, char *m);
};