std::experimental::make_exceptional_future
< cpp | experimental
|
在标头
<experimental/future> 定义 |
||
|
template < class T >
future<T> make_exceptional_future(std::exception_ptr ex); |
(1) | (并发 TS) |
|
template < class T, class E >
future<T> make_exceptional_future(E ex); |
(2) | (并发 TS) |
1) 创建立即就绪的
T 类型共享装填,并存储异常指针 ex ,然后返回与该共享状态该关联的 future ,如同用 promise<T> p; p.set_exception(ex); return p.get_future(); 。若 ex 为空则行为未定义。2) 创建立即就绪的
T 类型共享状态,并存储从 ex 构造的异常指针,然后返回与该共享状态关联的 future ,如同用 promise<T> p; p.set_exception(std::make_exception_ptr(ex)); return p.get_future(); 。返回值
与创建的共享状态关联的 future 对象。
参阅
|
(并发 TS)
|
产生立即就绪并保有指定值的 future (函数模板) |