Title
§[expected.object.swap]: Using value() instead of has_value()
Status
wp
Section
[expected.object.swap][expected.void.swap]
Submitter
Ben Craig

Created on 2023-06-25.00:00:00 last changed 5 months ago

Messages

Date: 2023-11-13.14:08:10

Proposed resolution:

This wording is relative to N4950.

  1. Modify [expected.object.swap] as indicated:

    constexpr void swap(expected& rhs) noexcept(see below);
    

    -1- […]

    -2- Effects: See Table 63 [tab:expected.object.swap].

    For the case where rhs.has_value() is false and this->has_value() is true, equivalent to: […]

  2. Modify [expected.void.swap] as indicated:

    constexpr void swap(expected& rhs) noexcept(see below);
    

    -1- […]

    -2- Effects: See Table 64 [tab:expected.void.swap].

    For the case where rhs.has_value() is false and this->has_value() is true, equivalent to: […]

Date: 2023-11-11.00:00:00

[ 2023-11-11 Approved at November 2023 meeting in Kona. Status changed: Voting → WP. ]

Date: 2023-10-15.00:00:00

[ 2023-10-27; Reflector poll ]

Set status to Tentatively Ready after seven votes in favour during reflector poll.

Date: 2023-06-25.00:00:00

[expected.object.swap] p2 has the following text in it:

For the case where rhs.value() is false and this->has_value() is true, equivalent to: […]

The table preceding that text is a table of this->has_value() vs. rhs.has_value(). The rhs.value() in the text is almost certainly a typo, as a .value() call here doesn't make any sense, especially if this is an expected<non-bool, E>.

The same issue is there for [expected.void.swap] p2.

History
Date User Action Args
2023-11-13 14:08:10adminsetmessages: + msg13846
2023-11-13 14:08:10adminsetstatus: voting -> wp
2023-11-07 21:41:54adminsetstatus: ready -> voting
2023-10-27 21:22:44adminsetmessages: + msg13765
2023-10-27 21:22:44adminsetstatus: new -> ready
2023-06-26 11:23:01adminsetmessages: + msg13670
2023-06-25 00:00:00admincreate