std::promise<R>:: operator=
From cppreference.net
C++
Concurrency support library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::promise
| Member functions | ||||
|
promise::operator=
|
||||
| Getting the result | ||||
| Setting the result | ||||
| Non-member Functions | ||||
| Helper Classes | ||||
|
promise
&
operator
=
(
promise
&&
other
)
noexcept
;
|
(1) | (自 C++11 起) |
|
promise
&
operator
=
(
const
promise
&
rhs
)
=
delete
;
|
(2) | (自 C++11 起) |
分配内容。
1)
移动赋值运算符。首先放弃共享状态(如同
~promise()
),然后如同通过执行
std::
promise
(
std
::
move
(
other
)
)
.
swap
(
*
this
)
来赋值
other
的共享状态。
2)
promise
不可复制赋值。
参数
| 其他 | - |
另一个
promise
用于从中获取状态
|
返回值
* this