Movatterモバイル変換


[0]ホーム

URL:



This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofWP status.

3940.std::expected<void, E>::value() also needsE to be copy constructible

Section: 22.8.7.6[expected.void.obs]Status:WPSubmitter: Jiang AnOpened: 2023-05-26Last modified: 2023-11-22

Priority:Not Prioritized

View all issues withWP status.

Discussion:

LWG3843(i) addedMandates: tostd::expected::value, but the similar handling is missing forexpected<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 toN4950.

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

    constexpr void value() const &;

    -?-Mandates:is_copy_constructible_v<E> istrue.

    -3-Throws:bad_expected_access(error()) ifhas_value() isfalse.

    constexpr void value() &&;

    -?-Mandates:is_copy_constructible_v<E> istrue andis_move_constructible_v<E> istrue.

    -4-Throws:bad_expected_access(std::move(error())) ifhas_value() isfalse.


[8]ページ先頭

©2009-2026 Movatter.jp