std::packaged_task<R(Args...)>:: operator=
From cppreference.net
<
cpp
|
thread
|
packaged task
C++
Concurrency support library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::packaged_task
| Member functions | ||||
|
packaged_task::operator=
|
||||
| Getting the result | ||||
| Execution | ||||
| Non-member functions | ||||
| Helper classes | ||||
|
(until C++17)
|
||||
| Deduction guides (C++17) |
|
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 を追加 |