std::make_exception_ptr
来自cppreference.com
| 在标头 <exception> 定义
|
||
| template< class E > std::exception_ptr make_exception_ptr( E e ) noexcept; |
(C++11 起) | |
创建一个保有到 e 副本的引用的 std::exception_ptr。这如同执行下列代码:
try { throw e; } catch(...) { return std::current_exception(); }
参数
| e | - | 要创建对其副本的引用的异常对象 |
返回值
std::exception_ptr 实例,它保有到 e 副本,或到 std::bad_alloc 实例,或到 std::bad_exception 实例的引用(参阅 std::current_exception)。
注解
参数按值传递,并受切片影响。
示例
| 本节未完成 原因:暂无示例 |
参阅
| (C++11) |
捕获当前异常到 std::exception_ptr 之中 (函数) |