typedef void (*unexpected_handler)();
The type of a handler function to be called by unexpected() when a function attempts to throw an exception not listed in its dynamic-exception-specification.
Required behavior: An unexpected_handler shall not return. See also [except.unexpected].
unexpected_handler set_unexpected(unexpected_handler f) noexcept;
Effects: Establishes the function designated by f as the current unexpected_handler.
Remark: It is unspecified whether a null pointer value designates the default unexpected_handler.
Returns: The previous unexpected_handler.
unexpected_handler get_unexpected() noexcept;
Returns: The current unexpected_handler. [ Note: This may be a null pointer value. — end note ]
[[noreturn]] void unexpected();
Remarks: Called by the implementation when a function exits via an exception not allowed by its exception-specification ([except.unexpected]), in effect after evaluating the throw-expression ([unexpected.handler]). May also be called directly by the program.
Effects: Calls the current unexpected_handler function. [ Note: A default unexpected_handler is always considered a callable handler in this context. — end note ]