------- Comment #7 from sabre at nondot dot org 2005-11-13 02:13 ------- > Yes because the normal operator new guarante not to return NULL by the C++ > standard.
Sure. > And if it returns a NULL that is undefined behavior, it should be > throwing an exception when memory could not be allocated (there is a nonthrow > version which can and will return NULL). Sure, fine, but you need not be calling the default/normal operator new. I can define an overload for operator new in a different translation unit, or even by dynamically loading a library with a different one. This is similar to replacing malloc. AFAICT, the C++ std does not say that the replacement operator new may not return null. -Chris -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19476