[comp.std.c++] set_new_handler

hansen@pegasus.ATT.COM (Tony L. Hansen) (08/17/90)

One of the "library" issues that Bjarne has shied away from specifying
within the reference part of E&S is that of the contents of <new.h> and the
guaranteed availability of set_new_handler(). Since E&S does NOT deal with
library issues at all, they (perhaps rightly) did not include anything
within it regarding <new.h> or set_new_handler().

Now if you look at page 280 on free store, you WILL see a description of
set_new_handler() WITHIN the commentary. However, this is NOT part of the
reference manual and has no binding on anything or anyone.

I found little else within E&S regarding <new.h> other than a statement
on page 7 requiring its existence.

The exact contents of <new.h> need to be specified within the final
standard, along with the expected interaction of operator new() in the
presence of a new handler. (Does new() loop? It's not required anywhere!)

					Tony Hansen
				att!pegasus!hansen, attmail!tony
				    hansen@pegasus.att.com

mjv@objects.mv.com (Michael J. Vilot) (08/21/90)

Tony Hansen writes:
> ... E&S does NOT deal with library issues at all ...
> The exact contents of <new.h> need to be specified within the final standard

In some ways, the standardization of the ANSI C++ library is more of a
challenge than the language itself.  The hardest part is that the
availability of templates and exceptions will eventually change what we
think is reasonable in a C++ library's design.

If we assume exceptions are part of the standard, we may find the
_new_handler approach is inappropriate.  On the other hand, if we end up
with an exception specification which has undesirable characteristics when
running out of free heap and/or stack space, we'll need to retain this
alternate approach.

Of course, we can't decide yet -- exceptions are not part of the standard,
and it will be some time before we have enough feedback from whatever
scheme we adopt.

It's certainly appropriate that E&S does not deal with library issues -- we
clearly need a lot more experience and discussion before we're in a position
to ``standardize existing practice.''

--
Mike Vilot,  ObjectWare Inc, Nashua NH
mjv@objects.mv.com  (UUCP:  ...!decvax!zinn!objects!mjv)