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);
};
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for