{transform,elements}_view::iterator::iterator_concept
should consider const-qualification of the underlying rangeSection: 25.7.9.3 [range.transform.iterator], 25.7.23.3 [range.elements.iterator] Status: C++23 Submitter: Tim Song Opened: 2021-05-23 Last modified: 2023-11-22
Priority: Not Prioritized
View all other issues in [range.transform.iterator].
View all issues with C++23 status.
Discussion:
transform_view::iterator<true>::iterator_concept
and
elements_view::iterator<true>::iterator_concept
(i.e.,
the const versions) are currently specified as looking at the properties of V
(i.e., the underlying view without const), while the actual iterator operations
are all correctly specified as using Base
(which includes
the const). iterator_concept
should do so too.
[2021-05-26; Reflector poll]
Set status to Tentatively Ready after six votes in favour during reflector poll.
[2021-06-07 Approved at June 2021 virtual plenary. Status changed: Voting → WP.]
Proposed resolution:
This wording is relative to N4885.
Modify 25.7.9.3 [range.transform.iterator] as indicated:
-1-
iterator::iterator_concept
is defined as follows:
(1.1) — If
models
VBaserandom_access_range
, theniterator_concept
denotesrandom_access_iterator_tag
.(1.2) — Otherwise, if
models
VBasebidirectional_range
, theniterator_concept
denotesbidirectional_iterator_tag
.(1.3) — Otherwise, if
models
VBaseforward_range
, theniterator_concept
denotesforward_iterator_tag
.(1.4) — Otherwise,
iterator_concept
denotesinput_iterator_tag
.
Modify 25.7.23.3 [range.elements.iterator] as indicated:
-1- The member typedef-name
iterator_concept
is defined as follows:
(1.1) — If
models
VBaserandom_access_range
, theniterator_concept
denotesrandom_access_iterator_tag
.(1.2) — Otherwise, if
models
VBasebidirectional_range
, theniterator_concept
denotesbidirectional_iterator_tag
.(1.3) — Otherwise, if
models
VBaseforward_range
, theniterator_concept
denotesforward_iterator_tag
.(1.4) — Otherwise,
iterator_concept
denotesinput_iterator_tag
.