Standard C++ Library Reference ISO/IEC (VERSION3)
terminate_handler
typedef void (*terminate_handler)();
The type describes a pointer to a function suitable for use as a terminate handler.
uncaught_exception
bool uncaught_exception();
The function returns true only if a thrown exception is being currently processed. Specifically, it
returns true after completing evaluation of a throw expression and before completing
initialization of the exception declaration in the matching handler or calling unexpected as a
result of the throw expression.
unexpected
void unexpected();
The function calls an unexpected handler, a function of type void (). If unexpected is
called directly by the program, the unexpected handler is the one most recently set by a call to
set_unexpected. If unexpected is called when control leaves a function by a thrown
exception of a type not permitted by an exception specification for the function, as in:
void func() throw() // function may throw no exceptions
{throw "bad"; } // throw calls unexpected()
the unexpected handler is the one in effect immediately after evaluating the throw expression.
An unexpected handler may not return to its caller. It may terminate execution by:
throwing an object of a type listed in the exception specification (or an object of any type
if the unexpected handler is called directly by the program)
●
throwing an object of type bad_exception●
calling terminate(), abort(), or exit(int)●
At program startup, the unexpected handler is a function that calls terminate().
unexpected_handler
typedef void (*unexpected_handler)();
The type describes a pointer to a function suitable for use as an unexpected handler.