名前空間
変種
操作

std::shared_future<T>::operator=

提供: cppreference.com
 
 
スレッドサポートライブラリ
スレッド
(C++11)
(C++20)
(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++11)
セマフォ
ラッチとバリア
(C++20)
(C++20)
フューチャー
(C++11)
(C++11)
(C++11)
 
 
(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

close