Files
cppdraft_translate/cppdraft/counted/iter/cmp.md
2025-10-25 03:02:53 +03:00

2.3 KiB
Raw Blame History

[counted.iter.cmp]

24 Iterators library [iterators]

24.5 Iterator adaptors [predef.iterators]

24.5.7 Counted iterators [iterators.counted]

24.5.7.6 Comparisons [counted.iter.cmp]

🔗

template<[common_with](concept.common#concept:common_with "18.4.6Concept common_­with[concept.common]")<I> I2> friend constexpr bool operator==( const counted_iterator& x, const counted_iterator<I2>& y);

1

#

Preconditions: x and y refer to elements of the same sequence ([counted.iterator]).

2

#

Effects: Equivalent to: return x.length == y.length;

🔗

friend constexpr bool operator==( const counted_iterator& x, default_sentinel_t) noexcept;

3

#

Effects: Equivalent to: return x.length == 0;

🔗

template<[common_with](concept.common#concept:common_with "18.4.6Concept common_­with[concept.common]")<I> I2> friend constexpr strong_ordering operator<=>( const counted_iterator& x, const counted_iterator<I2>& y);

4

#

Preconditions: x and y refer to elements of the same sequence ([counted.iterator]).

5

#

Effects: Equivalent to: return y.length <=> x.length;

6

#

[Note 1:

The argument order in the Effects: element is reversed because length counts down, not up.

— end note]