命名空间
变体
操作

std::shared_future<T>::operator=

来自 cppreference.cn
 
 
并发支持库
线程
(C++20)
this_thread 命名空间
(C++11)
(C++11)
(C++11)
协同取消
互斥
通用锁管理
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
条件变量
(C++11)
信号量
门闩和屏障
(C++20)
(C++20)
期值
(C++11)
(C++11)
(C++11)
(C++11)
安全回收
(C++26)
危险指针
原子类型
(C++20)
原子类型的初始化
(C++11)(C++20 中已弃用)
(C++11)(C++20 中已弃用)
内存排序
(C++11)(C++26 中已弃用)
原子操作的自由函数
原子标志的自由函数
 
 
(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() 相同的值。

[编辑] 参数

其他 - 一个 std::shared_future,它将状态转移到 *this

[编辑] 返回值

*this