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 f() 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:

At program startup, the unexpected handler is a function that calls terminate().