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

Created on 2019-09-13.00:00:00, last changed 2019-09-18.18:15:09.

Messages

Date: 2019-09-18.18:15:09

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: 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
2019-09-18 18:15:09adminsetmessages: + msg10655
2019-09-13 00:00:00admincreate