Try adding an exception specification to the function
definition, to tell the compiler that this operator new
won't
throw:
void* Object::operator new( size_t size, std::nothrow_t ) throw();
or if you have C++1:
void* Object::operator new( size_t size, std::nothrow_t) noexcept;
Without the exception specification, the compiler assumes that
the operator new
function will never return a null pointer.