Documentation Home >> Headers >> <jss/experimental_future.hpp> Header >> std::experimental::packaged_task >> std::experimental::packaged_task::swap Member Function

Exchange ownership of the asynchronous results associated with two std::experimental::packaged_task objects.

void swap(packaged_task& other);

Effects:

Exchange ownership of the asynchronous results and tasks associated with other and *this.

Postconditions:

The asynchronous result and task associated with other prior to the invocation of swap (if any) is associated with *this. The asynchronous result and task associated with *this prior to the invocation of swap (if any) is associated with other

Throws:

Nothing.

Header

#include <experimental/future>

See Also