名前空間
変種
操作

std::future<T>::operator=

提供: cppreference.com
< cpp‎ | thread‎ | future
 
 
スレッドサポートライブラリ
スレッド
(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)
 
 
future& operator=( future&& other )noexcept;
(1) (C++11以上)
future& operator=(const future& other )= delete;
(2) (C++11以上)

別のフューチャーオブジェクトの内容を代入します。

1) 共有状態を解放し、 other の内容を *this にムーブ代入します。 代入後、 other.valid()==false となり、 this->valid() は代入前の other.valid() と同じ値になります。

2) std::futureCopyAssignable ではありません。

[編集]引数

other - *this に状態を転送する std::future

[編集]戻り値

*this

close