std::make_exception_ptr

定义于头文件 <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::bad_alloc 实例,或到 std::bad_exception 实例的引用的 std::exception_ptr 实例(参阅 std::current_exception )。

注意

参数按值传递,并受切片影响。

参阅

std::exception_ptr 中捕获当前异常
(函数)

版本历史

  • (当前 | 先前 2017年5月17日 (三) 09:26Fruderica讨论 | 贡献. . (794字节) (-542). . (撤销)
  • 当前 | 先前 2013年7月2日 (二) 09:04P12bot讨论 | 贡献 . . (1,336字节) (-15). . (Use {{lc}}. Update links. Various fixes.) (撤销)
  • 当前 | 先前 2012年11月2日 (五) 15:33P12bot讨论 | 贡献 . . (1,351字节) (+289). . (r2.7.3) (机器人添加:de, en, es, fr, it, ja, pt, ru) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 11:36P12讨论 | 贡献 . . (1,062字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 07:00TranslationBot讨论 | 贡献. . (1,062字节) (-41). . (Translated from the English version using Google Translate) (撤销)
  • 当前 | 先前 2012年10月25日 (四) 14:25P12讨论 | 贡献 . . (1,103字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前) 2012年10月25日 (四) 13:00TranslationBot讨论 | 贡献. . (1,103字节) (+1,103). . (Translated from the English version using Google Translate)