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

Section: [text.encoding.aliases] Status: New Submitter: Jonathan Wakely Opened: 2024-01-16 Last modified: 2024-01-16 12:30:28 UTC

Priority: Not Prioritized

View all issues with New status.


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.

Proposed resolution:

This wording is relative to N4971.

  1. Modify [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]).