std::stop_token::operator=
提供: cppreference.com
< cpp | thread | stop token
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 のものにムーブ代入します。 代入後、 *this は other
の前の低紐付いた停止状態を持つようになり、 other
は紐付いた停止状態を持たないようになります。 stop_token(std::move(other)).swap(*this) と同等です。[編集] 引数
other | - | 停止状態を共有するまたは取得する別の stop_token オブジェクト
|
[編集] 例外
(なし)