I’ve been reading the C++11 spec, and I’m having trouble understanding the result of one of the std::promise object operators (std::promise& operator=(std::promise&& rhs) noexcept).
The spec says the effect is “Abandons any shared state and then as if promise(std::move(rhs)).swap(*this).”
I get that *this will equal the previous value of rhs, but what is the effect on rhs?
promise& operator=(promise&& rhs)tranfers the ownership of thestd::promisefrom one object to another. After the assigmentrhshas no associated async result, and*thishas the onerhshad before (if any).