Transfer ownership of the asynchronous result associated with one std::promise
object to another.
promise& operator=(promise&& other);
- Effects:
Transfer ownership of the asynchronous result associated with
otherto*this. If*thisalready had an associated asynchronous result, that asynchronous result is made ready with an exception of typestd::future_error, and an error code ofstd::future_errc::broken_promise.- Postconditions:
The asynchronous result associated with
otherprior to the invocation of the move-assignment operator is associated with the*this.otherhas no associated asynchronous result.- Returns:
*this- Throws:
Nothing.
Header
#include <future>