Calls the unexpected handler.
void unexpected( );
The C++ Standard requires that unexpected is called when a function throws an exception that is not on its throw list. The current implementation does not support this. The example calls unexpected directly, which calls the unexpected handler.
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.
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.
See set_unexpected for an example of the use of unexpected.