rethrow_exception
引发作为参数传递的异常。
void rethrow_exception(exception_ptr P);
参数
- P
要再次引发的已捕获异常。 如果 P 为 null exception_ptr,此函数将引发 std::bad_exception。
备注
在 exception_ptr 对象中存储捕获的异常后,主线程便可以处理该对象。 在主线程中,调用 exception_ptr 函数,将 rethrow_exception 对象作为其参数。 rethrow_exception 函数从 exception_ptr 对象中提取异常,然后在主线程的上下文中引发异常。