std::set_unexpected
Defined in header <exception> | | |
|---|---|---|
std::unexpected_handler set_unexpected( std::unexpected_handler f ); | | (until C++17) (deprecated since C++11) |
制造f新的全球std::unexpected_handler并返回先前安装的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) |
|---|
参数
f | - | pointer to function of type std::unexpected_handler, or null pointer |
|---|
返回值
以前安装的意外处理程序,如果没有安装,则为空指针值。
例外
(none) | (until C++11) |
|---|---|
noexcept specification: noexcept | (since C++11) |
另见
unexpected (until C++17) | function called when dynamic exception specification is violated (function) |
|---|---|
get_unexpected (C++11)(until C++17) | obtains the current unexpected_handler (function) |
unexpected_handler (until C++17) | the type of the function called by std::unexpected (typedef) |
© cppreference.com在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

