Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
Miscellaneous
Miscellaneous
complex
exception
functional
iterator
limits
locale
memory
new
numeric
stdexcept
typeinfo
utility
valarray
exception
bad_exception
exception
set_terminate
set_unexpected
terminate
terminate_handler
uncaught_exception
unexpected
unexpected_handler


exception

header

Standard exceptions

This header defines the base class for all standard exceptions thrown by the elements of the standard library: exception. It also defines the special exception bad_exception.

It also provides elements to access the unexpected and terminatehandlers:

When an exception is thrown, its type is checked twice:
- First, if the function has an exception-specification (a throw specifier at the function signature), the type is checked against these. If the type does not match, unexpected is called.
- Second, the exception type is checked against the exception handlers (catch blocks). If it does not match at any nesting level, terminate is called.

This header defines both unexpected and terminate along with functions to override their default behavior.

It also defines a function, uncaught_exception that returns whether an exception has been thrown and not yet handled.

Contents of <exception>:

Classes:

Functions:

Types: