public member function
<future>

std::packaged_task::swap

void swap (packaged_task& x) noexcept;
Swap packaged_task
Exchanges the shared state and stored task with x .

参数

x
Another packaged_task object of the same type (with the same template parameters, Ret and Args...).

返回值



数据竞争

x 和该对象都将被修改。

异常安全

无异常保证: 绝不抛出异常。

另见