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.

3292. iota_view is under-constrained

Section: [range.iota.view] Status: WP Submitter: Barry Revzin Opened: 2019-09-13 Last modified: 2020-09-06

Priority: Not Prioritized

View all issues with WP status.


P1207R4 changed weakly_incrementable from requiring semiregular to requiring default_constructible && movable.

iota_view currently is specified to require that W be just weakly_incrementable. But we have to copy the W from the view into its iterator and also in operator*() to return a W.

The shortest resolution is just to add " && semiregular<W>" to the class constraints.

[Status to ready after discussion Friday morning in Belfast]

Proposed resolution:

This wording is relative to N4830.

  1. Modify [range.iota.view] as indicated:

    namespace std::ranges {
      template<weakly_incrementable W, semiregular Bound = unreachable_sentinel_t>
        requires weakly-equality-comparable-with<W, Bound> && semiregular<W>
      class iota_view : public view_interface<iota_view<W, Bound> {