VMS Help
CXXLSTD, Runtime Support, new_handler

 *Conan The Librarian

 			   Standard C++	Library

 NAME

   new_handler, set_new_handler - new_handler is	the type of a function
   called by operator new() or operator	new []() when a	request	for
   storage can	not be met.  set_new_handler() is	a function
   which  sets the current new_handler.

 SYNOPSIS

   #include <new>

   namespace std	{
     typedef void (*new_handler)();
     new_handler	set_new_handler(new_handler new_h) throw();
   }

 DESCRIPTION

   set_new_handler() sets the current new_handler to the	the function
   passed in as	its new_handler	input parameter.  It returns the
   previous new_handler.

   A function of	type new_handler is required to	do one of the
   following:

     o make more	storage	available for allocation and return
     o throw an exception of type bad_alloc or a	class derived from
       bad_alloc
     o call abort() or exit()

   The Standard C++ Library provides a default new_handler which	throws
   an exception of type bad_alloc.	The implementation provided
   new_handler	is called by default.

 SEE ALSO

   new, bad_alloc

 STANDARDS CONFORMANCE
   ANSI X3J16/ISO WG21 Joint C++	Committee
  Close     Help