TITLE: set_new_handler PROBLEM: Dag Haugen Does anyone have a good example on using the standard set_new_handler ? Too me it looks like the one defined in ARM is more or less useless, but the _set_new_handler defined in MSVC is much more powerful (it can even be useful for real programs...) - unfortunately it is non- standard. If you disagree, please let me know why. If the draft standard has changed from the ARM, I would be interested in knowing. RESPONSE: kanze@lts.sel.alcatel.de (James Kanze), 28 Apr 95 In the draft standard, the default new handler throws an exception. New can *never* return NULL. (Would someone please correct me if I'm wrong. There is no explicit statement saying that new can never return NULL, but if I understand the specified semantics and the constraints on the new handler correctly, this is the case.) This is a change from the ARM, in which new returned NULL if no user defined new handler was installed. It is a sad fact of life that there are programmers who don't check this (and who don't install a user defined new handler). The set_new_handler is part of the standard, but there are only a few actions permitted in the user defined header: throw an exception, make more memory available, or call abort or exit. I might add the small reminder that there is no way to ensure that a user defined new handler is installed before the first calls to operator new occur (typically during the construction of static variables).