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

std::make_exception_ptr

Defined in header <exception>

?

?

template< class E > std::exception_ptr make_exception_ptr( E e );

?

(since C++11)

创建std::exception_ptr的副本的引用。e这就像执行以下代码一样:

二次

代码语言:javascript
复制
try {
    throw e;
} catch(...) {
    return std::current_exception();
}

二次

参数

%280%29

返回值

的实例std::exception_ptr保存对e的实例std::bad_alloc的实例std::bad_exception28%见std::current_exception29%。

例外

noexcept规格:

noexcept

注记

该参数是通过值传递的,并受切片的限制。

另见

current_exception (C++11)

captures the current exception in a std::exception_ptr (function)

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

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com