std::terminate_handler
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Diagnostics library
(until C++20*)
(C++17)(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Exception handling failures
terminate_handler
(C++11)
(until C++17*)
(until C++17*)
(until C++17*)
(until C++17*)
(TM TS)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++23)
(C++23)
(C++26)
(C++26)
(C++26)
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 .
A std::terminate_handler
shall terminate execution of the program without returning to the caller, otherwise the behavior is undefined.
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] Example
This section is incomplete
Reason: no example
Reason: no example