Namespaces
Variants

std::packaged_task<R(Args...)>:: operator=

From cppreference.net
Concurrency support library
Threads
(C++11)
(C++20)
this_thread namespace
(C++11)
(C++11)
Cooperative cancellation
Mutual exclusion
Generic lock management
Condition variables
(C++11)
Semaphores
Latches and Barriers
(C++20)
(C++20)
Futures
(C++11)
(C++11)
(C++11)
Safe reclamation
Hazard pointers
Atomic types
(C++11)
(C++20)
Initialization of atomic types
(C++11) (deprecated in C++20)
(C++11) (deprecated in C++20)
Memory ordering
(C++11) (deprecated in C++26)
Free functions for atomic operations
Free functions for atomic flags
packaged_task & operator = ( const packaged_task & ) = delete ;
(1) (C++11以降)
packaged_task & operator = ( packaged_task && rhs ) noexcept ;
(2) (C++11以降)
1) コピー代入演算子は削除されており、 std::packaged_task はムーブオンリーです。
2) 共有状態があればそれを解放し、以前保持していたタスクを破棄し、 rhs が所有していた共有状態とタスクを * this に移動する。 rhs は共有状態を持たず、移動後のタスクを持つ状態になる。

パラメータ

rhs - 移動元の std::packaged_task

不具合報告

以下の動作変更欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。

DR 適用対象 公開時の動作 正しい動作
LWG 2067 C++11 コピー代入演算子のパラメータ型は packaged_task& であった const を追加