We recommend using Visual Studio 2017

Compiler Error C2824

 

The latest version of this topic can be found at Compiler Error C2824.

return type for 'operator new' must be 'void *'

With non-based pointers, overloads of operator new must return void *.

The following sample generates 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);  
};  

Show: