public member function


move (1)
shared_future& operator= (shared_future&& rhs) noexcept;
copy (2)
shared_future& operator= (const shared_future& rhs);
Assign shared future
Assigns rhs:

(1) move-assignment
The object acquires the shared state of rhs (if any).
rhs is left with no shared state (as if default-constructed): it is no longer valid.
(2) copy-assignment
The object is associated with the same shared state as rhs (if any), with which it now shares ownership.
rhs is not modified.

If the object was valid (i.e., it had access to a shared state) before the call, it is disassociated from that shared state. If it was the only object associated to that shared state, the former shared state is itself also destroyed.


Another shared_future object of the same type (with the same template parameter T).

Return value


Data races

For the move assignment (1), both the object and rhs are modified.
For the copy assignment (2), the object is modified. rhs is accessed.

Exception safety

No-throw guarantee: never throws exceptions.

See also