Created on 2024-07-12.00:00:00 last changed 4 months ago
Proposed resolution:
This wording is relative to N4986.
Modify [move.iterator] as indicated:
[Drafting note:
Iterator
that models forward_iterator implies that iterator_traits<Iterator>::iterator_category is always valid as it satisfies the exposition-only conceptcpp17-iterator
.]
-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
modelsforward_iterator
. In that case, iterator_category denotes
(2.1) —
random_access_iterator_tag
if the typeiterator_traits<Iterator>::iterator_category
modelsderived_from<random_access_iterator_tag>
, and(2.2) —
iterator_traits<Iterator>::iterator_category
otherwise.
[ 2024-08-02; Reflector poll ]
Set priority to 3 after reflector poll.
"NAD, would be a major breaking change to something present since C++11."
"We're knowingly breaking the rules here for backwards compatibility. Should have a note here indicating that the rule is broken for good reason, and that you should do as the Standard says and not as the Standard does."
Following up LWG 4116, when the underlying iterator does not satisfy forward_iterator
,
move_iterator::operator++(int)
will return void
, which fails to meet the C++17 iterator
requirements, which should not provide iterator_category
.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-08-02 21:52:03 | admin | set | messages: + msg14293 |
2024-07-21 09:10:23 | admin | set | messages: + msg14256 |
2024-07-12 00:00:00 | admin | create |