This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.
views::indices is underconstrainedSection: 25.6.4.1 [range.iota.overview] Status: New Submitter: Hewill Kang Opened: 2025-10-15 Last modified: 2025-10-19
Priority: Not Prioritized
View all other issues in [range.iota.overview].
View all issues with New status.
Discussion:
Whether an integer-class type satisfies weakly_incrementable is unspecified according to
25.6.4.2 [range.iota.view]. For example, the library may provide a member
type alias difference_type for the integer-class type to make it weakly_incrementable, or not.
views::iota(integer-class-type(0)) is always ill-formed because
iota_view<W, Bound> requires W to be weakly_incrementable.
However, unlike views::iota, views::indices unconditionally accepts integer-class types,
which will lead to a hard error in the function body if the integer-class type is not
weakly_incrementable, which is true for both libstdc++ and MSVC-STL.
Proposed resolution:
This wording is relative to N5014.
Modify 25.6.4.1 [range.iota.overview] as indicated:
-4- The name
views::indicesdenotes a customization point object (16.3.3.3.5 [customization.point.object]). Given subexpressionE, letTberemove_cvref_t<decltype((E))>.views::indices(E)is expression-equivalent toviews::iota(T(0), E)ifis-integer-like<T>istrueandTmodelsweakly_incrementable, and ill-formed otherwise.