Title
std::expected<void, E>::value() also needs E to be copy constructible
Status
wp
Section
[expected.void.obs]
Submitter
Jiang An

Created on 2023-05-26.00:00:00 last changed 10 months ago

Messages

Date: 2023-06-19.14:50:03

Proposed resolution:

This wording is relative to N4950.

  1. Modify [expected.void.obs] as indicated:

    constexpr void value() const &;
    

    -?- Mandates: is_copy_constructible_v<E> is true.

    -3- Throws: bad_expected_access(error()) if has_value() is false.

    constexpr void value() &&;
    

    -?- Mandates: is_copy_constructible_v<E> is true and is_move_constructible_v<E> is true.

    -4- Throws: bad_expected_access(std::move(error())) if has_value() is false.

Date: 2023-06-17.00:00:00

[ 2023-06-17 Approved at June 2023 meeting in Varna. Status changed: Voting → WP. ]

Date: 2023-06-15.00:00:00

[ 2023-06-01; Reflector poll ]

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

Date: 2023-05-26.00:00:00

LWG 3843 added Mandates: to std::expected::value, but the similar handling is missing for expected<cv void, E>.

History
Date User Action Args
2023-06-19 14:50:03adminsetmessages: + msg13658
2023-06-19 14:50:03adminsetstatus: voting -> wp
2023-06-12 08:52:25adminsetstatus: ready -> voting
2023-06-01 14:05:48adminsetmessages: + msg13598
2023-06-01 14:05:48adminsetstatus: new -> ready
2023-05-28 07:48:27adminsetmessages: + msg13588
2023-05-26 00:00:00admincreate