-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
documentationRelated to documentation or commentsRelated to documentation or commentsfixedSomething works now, yay!Something works now, yay!rangesC++20/23 rangesC++20/23 ranges
Description
LWG-3543 Definition of when counted_iterators refer to the same sequence isn't quite right
In #1965, @frederick-vs-ja categorized this as:
Implemented at first, only comments should be updated.
_Same_sequenceperforms as least increments as possible, which is still OK for current wording
The comment is:
Lines 1278 to 1284 in 6fe2eae
| template <common_with<_Iter> _Other> | |
| friend constexpr void _Same_sequence( | |
| const counted_iterator& _Left, const counted_iterator<_Other>& _Right) noexcept { | |
| // Per N4861 [counted.iterator]/2, two counted_iterators x and y refer to elements of the same sequence iff | |
| // next(x.base(), x.count()) and next(y.base(), y.count()) "refer to the same element." Iterator equality is a | |
| // fair proxy for this condition. | |
| if constexpr (forward_iterator<_Iter> && forward_iterator<_Other>) { |
I agree that the comment should be updated to cite WG21-N4892's new wording. (It appears that this isn't a case where the comment should be removed entirely.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationRelated to documentation or commentsRelated to documentation or commentsfixedSomething works now, yay!Something works now, yay!rangesC++20/23 rangesC++20/23 ranges