std::expected<void, E>::value()
also needs E
to be copy constructibleSection: 22.8.7.6 [expected.void.obs] Status: WP Submitter: Jiang An Opened: 2023-05-26 Last modified: 2023-11-22
Priority: Not Prioritized
View all issues with WP status.
Discussion:
LWG 3843 added Mandates: to std::expected::value
, but the similar handling is
missing for expected<cv void, E>
.
[2023-06-01; Reflector poll]
Set status to Tentatively Ready after seven votes in favour during reflector poll.
[2023-06-17 Approved at June 2023 meeting in Varna. Status changed: Voting → WP.]
Proposed resolution:
This wording is relative to N4950.
Modify 22.8.7.6 [expected.void.obs] as indicated:
constexpr void value() const &;-?- Mandates:
-3- Throws:is_copy_constructible_v<E>
istrue
.bad_expected_access(error())
ifhas_value()
isfalse
.constexpr void value() &&;-?- Mandates:
-4- Throws:is_copy_constructible_v<E>
istrue
andis_move_constructible_v<E>
istrue
.bad_expected_access(std::move(error()))
ifhas_value()
isfalse
.