- Since
- C++98
Classes and functions for reporting errors via exceptions.
◆ __cpp_lib_uncaught_exceptions
#define __cpp_lib_uncaught_exceptions |
◆ terminate_handler
typedef void(* std::terminate_handler) () |
If you write a replacement terminate handler, it must be of this type.
Definition at line 68 of file exception.
◆ unexpected_handler
typedef void(* std::unexpected_handler) () |
If you write a replacement unexpected handler, it must be of this type.
Definition at line 71 of file exception.
◆ __verbose_terminate_handler()
void __gnu_cxx::__verbose_terminate_handler |
( |
| ) |
|
◆ current_exception()
Obtain an exception_ptr to the currently handled exception. If there is none, or the currently handled exception is foreign, return the null value.
Referenced by std::make_exception_ptr().
◆ get_terminate()
Return the current terminate handler.
◆ get_unexpected()
Return the current unexpected handler.
◆ make_exception_ptr()
◆ rethrow_exception()
◆ rethrow_if_nested()
template<typename _Ex >
void std::rethrow_if_nested |
( |
const _Ex & |
__ex | ) |
|
|
inline |
◆ set_terminate()
Takes a new handler function as an argument, returns the old function.
◆ set_unexpected()
Takes a new handler function as an argument, returns the old function.
◆ terminate()
The runtime will call this function if exception handling must be abandoned for any reason. It can also be called by the user.
◆ throw_with_nested()
template<typename _Tp >
void std::throw_with_nested |
( |
_Tp && |
__t | ) |
|
|
inline |
If __t
is derived from nested_exception, throws __t
. Else, throws an implementation-defined object derived from both.
Definition at line 118 of file nested_exception.h.
◆ uncaught_exception()
bool std::uncaught_exception |
( |
| ) |
|
|
noexcept |
[18.6.4]/1: 'Returns true after completing evaluation of a throw-expression until either completing initialization of the exception-declaration in the matching handler or entering unexpected()
due to the throw; or after entering terminate()
for any reason other than an explicit call to terminate()
. [Note: This includes stack unwinding [15.2]. end note]'
2: 'When uncaught_exception()
is true, throwing an exception can result in a call of 1terminate()‘ (15.5.1).’
◆ uncaught_exceptions()
int std::uncaught_exceptions |
( |
| ) |
|
|
noexcept |
The number of uncaught exceptions.
- Since
- C++17, or any non-strict mode, e.g.
-std=gnu++98
- See also
- uncaught_exception()
◆ unexpected()
The runtime will call this function if an exception is thrown which violates the function's exception specification.