std::promise<R>:: promise
From cppreference.net
C++
Concurrency support library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::promise
| Member functions | ||||
|
promise::promise
|
||||
| Getting the result | ||||
| Setting the result | ||||
| Non-member Functions | ||||
| Helper Classes | ||||
|
promise
(
)
;
|
(1) | (自 C++11 起) |
|
template
<
class
Alloc
>
promise ( std:: allocator_arg_t , const Alloc & alloc ) ; |
(2) | (自 C++11 起) |
|
promise
(
promise
&&
other
)
noexcept
;
|
(3) | (自 C++11 起) |
|
promise
(
const
promise
&
other
)
=
delete
;
|
(4) | (自 C++11 起) |
构造一个
promise
对象。
1)
默认构造函数。构造具有空共享状态的 promise。
3)
移动构造函数。使用移动语义构造具有
other
共享状态的 promise。构造完成后,
other
不再拥有共享状态。
4)
promise
不可复制。
参数
| alloc | - | 用于分配共享状态的分配器 |
| other | - |
用于获取状态的另一个
promise
|
异常
1,2)
可能抛出由实现定义的异常。
示例
|
本节内容不完整
原因:缺少示例 |