std::experimental::future<T>::future
来自cppreference.com
< cpp | experimental | future
future()
noexcept;
|
(1) | |
future(std::experimental::future<T>&&
f)
noexcept;
|
(2) | |
future(const
std::experimental::future<T>&)
=
delete;
|
(3) | |
future(std::experimental::future<std::experimental::future<T>>
&&
other)
noexcept;
|
(4) | |
1) 默认构造函数。构造不指代共享状态的空
future
对象。2) 构造
future
,转移
f
所保有的共享状态,若存在。构造后 f.valid() 为 false 。3) 复制构造函数被删除。不能复制
future
。4) 从
other
所指代的共享状态构造
future
对象。结果 future
的对象在下列之一发生时变为就绪:
- other
与 other.get()
均就绪。存储来自 other.get()
的值或异常到与结果
future
状态关联的共享状态中。 - other
就绪,但 other.get()
非法。存储以 std::future_errc::broken_promise
为错误条件的 std::future_error
类型异常到与结果
future
对象关联的共享状态中。
此构造函数返回后, valid()
== true 而 other.valid()
== false 。
参数
f | - | 用以初始化的另一 future 对象 |
other | - | 要解包装的 std::experimental::future 对象
|
示例
本节未完成 原因:暂无示例 |
参阅
构造 future 对象 ( std::future<T>
的公开成员函数) |