std::shared_future<T>::operator=
来自cppreference.com
< cpp | thread | shared future
并发支持库
|
|
std::shared_future
成员函数 | ||||
shared_future::operator=
|
||||
获取结果 | ||||
状态 | ||||
(1) | ||
shared_future&
operator=(
const
shared_future&
other );
|
(C++11
起) (C++17 前) |
|
shared_future&
operator=(
const
shared_future&
other )
noexcept;
|
(C++17 起) | |
shared_future&
operator=(
shared_future&&
other )
noexcept;
|
(2) | (C++11 起) |
赋值另一 shared_future
的内容。
1) 释放任何共享状态并赋值
other
的内容给 *this 。赋值后,
this->valid()
== other.valid() 。2) 释放任何共享状态并移动赋值
other
的内容给 *this 。赋值后,
other.valid()
== false 且 this->valid()
将产生与 other.valid() 在赋值前相同的值。
参数
other | - | 将转移状态给 *this
的 std::shared_future
|
返回值
*this