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

4038. std::text_encoding::aliases_view should have constexpr iterators

Section: 30.6.2.5 [text.encoding.aliases] Status: WP Submitter: Jonathan Wakely Opened: 2024-01-16 Last modified: 2024-04-02

Priority: Not Prioritized

View all issues with WP status.

Discussion:

aliases_view::begin() and aliases_view::end() are constexpr functions, but there is no requirement that you can use the returned iterator and sentinel in constant expressions.

[2024-03-12; Reflector poll]

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

[Tokyo 2024-03-23; Status changed: Voting → WP.]

Proposed resolution:

This wording is relative to N4971.

  1. Modify 30.6.2.5 [text.encoding.aliases] as indicated:

    struct text_encoding::aliases_view : ranges::view_interface<text_encoding::aliases_view> {
      constexpr implementation-defined begin() const;
      constexpr implementation-defined end() const;
    };
    

    -1- text_encoding::aliases_view models copyable, ranges::view, ranges::random_access_range, and ranges::borrowed_range.

    -2- Both ranges::range_value_t<text_encoding::aliases_view> and ranges::range_reference_t<text_encoding::aliases_view> denote const char*.

    -?- ranges::iterator_t<text_encoding::aliases_view> is a constexpr iterator (25.3.1 [iterator.requirements.general]).