A
Alex Vinokur
Hi,
I need to overload new operator.
Hoever, there is some problem with new (std::nothrow).
Is there any way to resolve the problem without '#undef new' below?
--------------------------------------
#define NEW new(size, __FILE__, __LINE__)
#define new NEW
int main()
{
char* p1 = new char; // Actiually new(size, __FILE__, __LINE__)
#ifdef new
#undef new
char* p2 = new (std::nothrow) char;
#define NEW
#endif
}
--------------------------------------
I need to overload new operator.
Hoever, there is some problem with new (std::nothrow).
Is there any way to resolve the problem without '#undef new' below?
--------------------------------------
#define NEW new(size, __FILE__, __LINE__)
#define new NEW
int main()
{
char* p1 = new char; // Actiually new(size, __FILE__, __LINE__)
#ifdef new
#undef new
char* p2 = new (std::nothrow) char;
#define NEW
#endif
}
--------------------------------------