◐ Shell
clean mode source ↗

std::shared_future<T>::operator= - cppreference.com

并发支持库

线程

(C++11)

(C++20)

this_thread 命名空间

(C++11)

(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++11)

(C++20)

原子类型的初始化

(C++11)(C++20 弃用)

(C++11)(C++20 弃用)

内存定序

(C++11)(C++26 弃用)

原子操作的自由函数
原子标志的自由函数
shared_future& operator=( const shared_future& other );
(1) (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() == falsevalid 将产生与 other.valid() 在赋值前相同的值。

参数

other - 将转移状态给 *thisstd::shared_future

返回值

*this