std::terminate_handler

From cppreference.com
< cpp‎ | error
 
 
Utilities library
Type support (basic types, RTTI, type traits)
Dynamic memory management
Error handling
Program utilities
Variadic functions
Date and time
Function objects
(C++11)
Relational operators
Optional and any
(C++17)
(C++17)
Pairs and tuples
(C++11)
(C++17)
Swap, forward and move
(C++14)
(C++11)
(C++11)
Type operations
(C++11)
(C++17)
 
Error handling
Exception handling
(C++11)
(C++17)
Exception handling failures
terminate_handler
(C++11)
(deprecated)
(deprecated)
(C++11)(deprecated)
(deprecated)
 
Defined in header <exception>
typedef void (*terminate_handler)();

std::terminate_handler is the function pointer type (pointer to function that takes no arguments and returns void), which is installed and queried by the functions std::set_terminate and std::get_terminate and called by std::terminate.

The C++ implementation provides a default std::terminate_handler function, which calls std::abort(). If the null pointer value is installed (by means of std::set_terminate), the implementation may restore the default handler instead.

[edit] See also

function called when exception handling fails
(function)
changes the function to be called by std::terminate
(function)
obtains the current terminate_handler
(function)