名前空間
変種
操作

std::stop_token::operator=

提供: cppreference.com
< cpp‎ | thread‎ | stop token
 
 
スレッドサポートライブラリ
スレッド
(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++11)
条件変数
(C++11)
セマフォ
ラッチとバリア
(C++20)
(C++20)
フューチャー
(C++11)
(C++11)
(C++11)
(C++11)
 
 
std::stop_token& operator=( const std::stop_token& other ) noexcept;
(1) (C++20以上)
std::stop_token& operator=( std::stop_token&& other ) noexcept;
(2) (C++20以上)

紐付いた停止状態を other のもので置き換えます。

1) other の紐付いた停止状態を *this のものにコピー代入します。 stop_token(other).swap(*this) と同等です。
2) other の紐付いた停止状態を *this のものにムーブ代入します。 代入後、 *thisother の前の低紐付いた停止状態を持つようになり、 other は紐付いた停止状態を持たないようになります。 stop_token(std::move(other)).swap(*this) と同等です。

[編集] 引数

other - 停止状態を共有するまたは取得する別の stop_token オブジェクト

[編集] 例外

(なし)