Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/error/set unexpected"

From cppreference.com
< cpp‎ | error
(since C++11)
(p0003r5 (until c++17))
Line 3: Line 3:
 
{{dcl begin}}
 
{{dcl begin}}
 
{{dcl header | exception}}
 
{{dcl header | exception}}
{{dcl | notes={{mark| deprecated since C++11}} | 1=
+
{{dcl | notes={{mark| deprecated since C++11}} | until=c++17| 1=
 
std::unexpected_handler set_unexpected( std::unexpected_handler f );
 
std::unexpected_handler set_unexpected( std::unexpected_handler f );
 
}}
 
}}

Revision as of 09:44, 6 December 2016

 
 
 
Defined in header <exception>
(until C++17)
(deprecated since C++11)

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 C++11)

Contents

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.

Exceptions

(none) (until C++11)
noexcept specification:  
noexcept
  
(since C++11)

See also

(deprecated in C++11)(removed in C++17)
function called when dynamic exception specification is violated
(function) [edit]
(deprecated in C++11)(removed in C++17)
obtains the current unexpected_handler
(function) [edit]
(deprecated in C++11)(removed in C++17)
the type of the function called by std::unexpected
(typedef) [edit]