23 Iterators library [iterators]

23.5 Iterator adaptors [predef.iterators]

23.5.6 Counted iterators [iterators.counted]

23.5.6.6 Comparisons [counted.iter.cmp]

template<common_­with<I> I2> friend constexpr bool operator==( const counted_iterator& x, const counted_iterator<I2>& y);
Preconditions: x and y refer to elements of the same sequence ([counted.iterator]).
Effects: Equivalent to: return x.length == y.length;
friend constexpr bool operator==( const counted_iterator& x, default_sentinel_t);
Effects: Equivalent to: return x.length == 0;
template<common_­with<I> I2> friend constexpr strong_ordering operator<=>( const counted_iterator& x, const counted_iterator<I2>& y);
Preconditions: x and y refer to elements of the same sequence ([counted.iterator]).
Effects: Equivalent to: return y.length <=> x.length;
[Note
:
The argument order in the Effects: element is reversed because length counts down, not up.
— end note
]