-
Notifications
You must be signed in to change notification settings - Fork 0
Description
https://cplusplus.github.io/LWG/issue4158
Could SG1 please take a look and confirm that they're happy for us to strike the explicit "Abandons/Releases the shared state" wording from both promise::operator=
and packaged_task::operator=
.
Technically, the current wording requires abandoning/releasing the state first, before transferring creating the temporary and swapping. After this change, the state will be implicitly abandoned by the temporary's destructor. The difference is observable for packaged_task
, because another thread can observe whether the shared state is made ready before or after the stored task is moved to a new packaged_task
. However, none of the major std::lib impls actually do it that way, so users aren't getting the order currently specified in the standard anyway.
So this simplifies the spec of promise
, and simplifies and fixes the broken spec of packaged_task
which previously failed to make the state ready by abandoning it. In both cases the proposed change makes the move-assignment operators safe for self-assignment, so that p = std::move(p)
becomes a no-op instead of needlessly abandoning the state and leaving p
empty.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status