3.4 KiB
[common.iter.cmp]
24 Iterators library [iterators]
24.5 Iterator adaptors [predef.iterators]
24.5.5 Common iterators [iterators.common]
24.5.5.6 Comparisons [common.iter.cmp]
template<class I2, [sentinel_for](iterator.concept.sentinel#concept:sentinel_for "24.3.4.7 Concept sentinel_for [iterator.concept.sentinel]")<I> S2> requires [sentinel_for](iterator.concept.sentinel#concept:sentinel_for "24.3.4.7 Concept sentinel_for [iterator.concept.sentinel]")<S, I2> friend constexpr bool operator==( const common_iterator& x, const common_iterator<I2, S2>& y);
Hardened preconditions: x.v_.valueless_by_exception() and y.v_.valueless_by_exception() are each false.
Returns: true if i == j, and otherwise get(x.v_) == get(y.v_), where i is x.v_.index() and j is y.v_.index().
template<class I2, [sentinel_for](iterator.concept.sentinel#concept:sentinel_for "24.3.4.7 Concept sentinel_for [iterator.concept.sentinel]")<I> S2> requires [sentinel_for](iterator.concept.sentinel#concept:sentinel_for "24.3.4.7 Concept sentinel_for [iterator.concept.sentinel]")<S, I2> && [equality_comparable_with](concept.equalitycomparable#concept:equality_comparable_with "18.5.4 Concept equality_comparable [concept.equalitycomparable]")<I, I2> friend constexpr bool operator==( const common_iterator& x, const common_iterator<I2, S2>& y);
Hardened preconditions: x.v_.valueless_by_exception() and y.v_.valueless_by_exception() are each false.
Returns: true if i and j are each 1, and otherwiseget(x.v_) == get(y.v_), wherei is x.v_.index() and j is y.v_.index().
template<[sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_sentinel_for [iterator.concept.sizedsentinel]")<I> I2, [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_sentinel_for [iterator.concept.sizedsentinel]")<I> S2> requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_sentinel_for [iterator.concept.sizedsentinel]")<S, I2> friend constexpr iter_difference_t<I2> operator-( const common_iterator& x, const common_iterator<I2, S2>& y);
Hardened preconditions: x.v_.valueless_by_exception() and y.v_.valueless_by_exception() are each false.
Returns: 0 if i and j are each 1, and otherwiseget(x.v_) - get(y.v_), wherei is x.v_.index() and j is y.v_.index().