Documentation Home >> Headers >> <jss/experimental_future.hpp> Header >> std::experimental::packaged_task >> std::experimental::packaged_task Move-Assignment Operator

Transfer ownership of the asynchronous result associated with one std::experimental::packaged_task object to another.

packaged_task& operator=(packaged_task&& other);

Effects:

Transfer ownership of the asynchronous result and task associated with other to *this. If *this already had an associated asynchronous result, that asynchronous result is made ready with an exception of type std::future_error, and an error code of std::future_errc::broken_promise.

Postconditions:

The asynchronous result and task associated with other prior to the invocation of the move-assignment operator is associated with the *this. other has no associated asynchronous result or task.

Returns:

*this

Throws:

Nothing.

Header

#include <experimental/future>

See Also