This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of NAD status.
basic_const_iterator
is too strict to provide iterator_category
Section: 24.5.3.4 [const.iterators.types] Status: NAD Submitter: Hewill Kang Opened: 2023-01-22 Last modified: 2023-02-06
Priority: Not Prioritized
View all issues with NAD status.
Discussion:
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.
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>
.
[2023-02-06 Status changed: New → NAD.]
Set status to NAD after reflector poll.
Proposed resolution:
This wording is relative to N4928.
Modify 24.5.3.4 [const.iterators.types] as indicated:
-2- The member typedef-name
iterator_category
is defined if and only if the qualified-iditerator_traits<Iterator>::iterator_category
is valid and denotes a type. In that case,Iterator
modelsforward_iterator
basic_const_iterator<Iterator>::iterator_category
denotes the typeiterator_traits<Iterator>::iterator_category
.