Issue 3555: {transform,elements}_view::iterator::iterator_concept
should consider const-qualification of the underlying range (original) (raw)
This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++23 status.
3555. {transform,elements}_view::_iterator_::iterator_conceptshould consider const-qualification of the underlying range
Section: 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 andelements_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.
The proposed resolution has been implemented and tested on top of libstdc++.
[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_conceptis defined as follows:- (1.1) — If
~~V~~_Base_modelsrandom_access_range, theniterator_conceptdenotesrandom_access_iterator_tag. - (1.2) — Otherwise, if
~~V~~_Base_modelsbidirectional_range, theniterator_conceptdenotesbidirectional_iterator_tag. - (1.3) — Otherwise, if
~~V~~_Base_modelsforward_range, theniterator_conceptdenotesforward_iterator_tag. - (1.4) — Otherwise,
iterator_conceptdenotesinput_iterator_tag.
- (1.1) — If
- Modify 25.7.23.3 [range.elements.iterator] as indicated:
-1- The member typedef-name
iterator_conceptis defined as follows:- (1.1) — If
~~V~~_Base_modelsrandom_access_range, theniterator_conceptdenotesrandom_access_iterator_tag. - (1.2) — Otherwise, if
~~V~~_Base_modelsbidirectional_range, theniterator_conceptdenotesbidirectional_iterator_tag. - (1.3) — Otherwise, if
~~V~~_Base_modelsforward_range, theniterator_conceptdenotesforward_iterator_tag. - (1.4) — Otherwise,
iterator_conceptdenotesinput_iterator_tag.
- (1.1) — If