diff --git a/xml/issue4158.xml b/xml/issue4158.xml index 4471a7ace8..bbefc9270c 100644 --- a/xml/issue4158.xml +++ b/xml/issue4158.xml @@ -77,7 +77,17 @@ calls `packaged_task(std::move(rhs)).swap(*this)`. 2024-10-02; Jonathan provides improved wording

Following reflector discussion, remove the "Releases any shared state" text -completely. The remaining effects imply that the state will be abandoned anyway.

+completely. +The remaining effects imply that the state will be abandoned anyway. +This makes it safe against self-assignment. +

+ +2024-10-02; LWG telecon +

+Agreed to change `promise` the same way, which is safe for self-assignment +and matches what all three of libstdc++, libc++ and MSVC do today. +Ask SG1 to review. +

@@ -86,6 +96,21 @@ completely. The remaining effects imply that the state will be abandoned anyway. This wording is relative to .

    + +
  1. Modify as indicated:

    +
    +
    +promise& operator=(promise&& rhs) noexcept;
    +
    +

    -2- Effects: + +Abandons any shared state () and then as if + +Equivalent to +`promise(std::move(rhs)).swap(*this)`. +

    +
    +
  2. Modify as indicated: