Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
HP.com home

HP C++ User Documentation

 

new_handler (3C++std) - Tru64 UNIX

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
About PDF files: The PDF files on this site can be read online or printed using Adobe® Acrobat® Reader. If you do not have this software on your system, you may download it from Adobe's website.
Privacy statement Using this site means you accept its terms C++ support
© 2008 Hewlett-Packard Development Company, L.P.