Title
{transform,elements}_view::iterator::iterator_concept should consider const-qualification of the underlying range
Status
c++23
Section
[range.transform.iterator] [range.elements.iterator]
Submitter
Tim Song

Created on 2021-05-23.00:00:00 last changed 12 months ago

Messages

Date: 2021-06-07.16:58:04

Proposed resolution:

This wording is relative to N4885.

  1. Modify [range.transform.iterator] as indicated:

    -1- iterator::iterator_concept is defined as follows:

    1. (1.1) — If VBase models random_access_range, then iterator_concept denotes random_access_iterator_tag.

    2. (1.2) — Otherwise, if VBase models bidirectional_range, then iterator_concept denotes bidirectional_iterator_tag.

    3. (1.3) — Otherwise, if VBase models forward_range, then iterator_concept denotes forward_iterator_tag.

    4. (1.4) — Otherwise, iterator_concept denotes input_iterator_tag.

  2. Modify [range.elements.iterator] as indicated:

    -1- The member typedef-name iterator_concept is defined as follows:

    1. (1.1) — If VBase models random_access_range, then iterator_concept denotes random_access_iterator_tag.

    2. (1.2) — Otherwise, if VBase models bidirectional_range, then iterator_concept denotes bidirectional_iterator_tag.

    3. (1.3) — Otherwise, if VBase models forward_range, then iterator_concept denotes forward_iterator_tag.

    4. (1.4) — Otherwise, iterator_concept denotes input_iterator_tag.

Date: 2021-06-07.00:00:00

[ 2021-06-07 Approved at June 2021 virtual plenary. Status changed: Voting → WP. ]

Date: 2021-05-15.00:00:00

[ 2021-05-26; Reflector poll ]

Set status to Tentatively Ready after six votes in favour during reflector poll.

Date: 2021-05-23.16:54:38

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.

The proposed resolution has been implemented and tested on top of libstdc++.

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2021-06-07 16:58:04adminsetmessages: + msg11916
2021-06-07 16:58:04adminsetstatus: voting -> wp
2021-05-26 21:11:22adminsetstatus: ready -> voting
2021-05-26 10:53:33adminsetmessages: + msg11859
2021-05-26 10:53:33adminsetstatus: new -> ready
2021-05-23 13:20:30adminsetmessages: + msg11847
2021-05-23 00:00:00admincreate