首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

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)

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券