Annex D (normative) Compatibility features [depr]

D.11 Violating exception-specifications [exception.unexpected]

D.11.1 Type unexpected_handler [unexpected.handler]

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].

Default behavior: The implementation's default unexpected_handler calls std::terminate().

D.11.2 set_unexpected [set.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.

D.11.3 get_unexpected [get.unexpected]

unexpected_handler get_unexpected() noexcept;

Returns: The current unexpected_handler. [ Note: This may be a null pointer value.  — end note ]

D.11.4 unexpected [unexpected]

[[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 ]