KK> Doesn't new already return NULL, or 0, on failure?
KK> It does in VC++ 4.0.
KK> Borland supplies a new_handler() function, but advises the
KK> overloading of new also.
Description
set_new_handler installs the function to be called when the global operator
new() or operator new
[]() cannot allocate the requested memory. By default the new operators throw
an xalloc exception if memory cannot be allocated. You can change this
efault
behavior by calling set_new_handler to set a new handler. To retain the
traditional version of new, which does not throw exceptions, you can use
set_new_handler(0).
This if from BC4.52 help files. "The traditional version of new,
which does not throw execptions..."
This is ANSI C++ but not ANSI C compatible.
--- GEcho 1.00
---------------
* Origin: Digital OnLine Magazine! - (409)838-8237 (1:3811/350)
|