Title
iota_view is under-constrained
Status
c++20
Section
[range.iota.view]
Submitter
Barry Revzin

Created on 2019-09-13.00:00:00 last changed 37 months ago

Messages

Date: 2020-01-05.16:32:39

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> {
        […]
      };
      […]
    }
    
Date: 2020-01-05.16:32:39

[ Status to ready after discussion Friday morning in Belfast ]

Date: 2019-09-13.00:00:00

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.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2020-02-24 16:02:59adminsetstatus: voting -> wp
2020-01-17 04:54:50adminsetstatus: ready -> voting
2020-01-05 16:32:39adminsetmessages: + msg10914
2020-01-05 16:32:39adminsetstatus: new -> ready
2019-09-18 18:15:09adminsetmessages: + msg10655
2019-09-13 00:00:00admincreate