Title
basic_const_iterator is too strict to provide iterator_category
Status
nad
Section
[const.iterators.types]
Submitter
Hewill Kang

Created on 2023-01-22.00:00:00 last changed 22 months ago

Messages

Date: 2023-02-06.15:13:48

Proposed resolution:

This wording is relative to N4928.

  1. Modify [const.iterators.types] as indicated:

    -2- The member typedef-name iterator_category is defined if and only if the qualified-id iterator_traits<Iterator>::iterator_category is valid and denotes a typeIterator models forward_iterator. In that case, basic_const_iterator<Iterator>::iterator_category denotes the type iterator_traits<Iterator>::iterator_category.

Date: 2023-02-06.00:00:00

[ 2023-02-06 Status changed: New → NAD. ]

Set status to NAD after reflector poll.

Date: 2023-01-22.00:00:00

Currently, basic_const_iterator provides iterator_category member only when the underlying iterator models forward_iterator, which means that it will not provide input_iterator_tag when applied to any C++17 legacy iterator.

This seems undesirable, and it should be more appropriate to provide iterator_category only by detecting whether the iterator_traits specialization of the underlying iterator has a valid iterator_category, as is common practice for other iterator adaptors in <iterator>.

History
Date User Action Args
2023-02-06 15:13:48adminsetmessages: + msg13264
2023-02-06 15:13:48adminsetstatus: new -> nad
2023-01-28 12:01:08adminsetmessages: + msg13216
2023-01-22 00:00:00admincreate