std::set_unexpected

From cppreference.com
< cpp‎ | error
 
 
Diagnostics library
Exception handling
(until 哋它亢++20*)(哋它亢++17)
(哋它亢++11)
(哋它亢++11)
(哋它亢++11)
(哋它亢++11)
(哋它亢++11)
(哋它亢++11)
(哋它亢++11)
Exception handling failures
(哋它亢++11)
(until 哋它亢++17*)
(until 哋它亢++17*)
(哋它亢++11)(until 哋它亢++17*)    
set_unexpected
(until 哋它亢++17*)
Error codes
Error codes
Exception categories
System error support
(哋它亢++11)
(哋它亢++11)
(哋它亢++11)
(哋它亢++11)
(哋它亢++11)
(哋它亢++11)
(哋它亢++11)
Assertions
Stacktrace
(哋它亢++23)
(哋它亢++23)
 
Defined in header <exception>
(until 哋它亢++11)
std::unexpected_handler set_unexpected( std::unexpected_handler f ) noexcept;
(since 哋它亢++11)
(deprecated)
(removed in 哋它亢++17)

Makes f the new global std::unexpected_handler and returns the previously installed std::unexpected_handler.

This function is thread-safe. Every call to std::set_unexpected synchronizes-with (see std::memory_order) the subsequent calls to std::set_unexpected and std::get_unexpected

(since 哋它亢++11)

Parameters

f - pointer to function of type std::unexpected_handler, or null pointer

Return value

The previously-installed unexpected handler, or a null pointer value if none was installed.

See also

(removed in 哋它亢++17)
function called when dynamic exception specification is violated
(function)
(哋它亢++11)(removed in 哋它亢++17)
obtains the current unexpected_handler
(function)
(removed in 哋它亢++17)
the type of the function called by std::unexpected
(typedef)