22 Iterators library [iterators]

22.5 Iterator adaptors [predef.iterators]

22.5.4 Common iterators [iterators.common]

22.5.4.6 Comparisons [common.iter.cmp]

template<class I2, Sentinel<I> S2> requires Sentinel<S, I2> friend bool operator==( const common_iterator& x, const common_iterator<I2, S2>& y);
Expects: x.v_­.valueless_­by_­exception() and y.v_­.valueless_­by_­exception() are each false.
Returns: true if i == j, and otherwise get<i>(x.v_­) == get<j>(y.v_­), where i is x.v_­.index() and j is y.v_­.index().
template<class I2, Sentinel<I> S2> requires Sentinel<S, I2> && EqualityComparableWith<I, I2> friend bool operator==( const common_iterator& x, const common_iterator<I2, S2>& y);
Expects: x.v_­.valueless_­by_­exception() and y.v_­.valueless_­by_­exception() are each false.
Returns: true if i and j are each 1, and otherwise get<i>(x.v_­) == get<j>(y.v_­), where i is x.v_­.index() and j is y.v_­.index().
template<class I2, Sentinel<I> S2> requires Sentinel<S, I2> friend bool operator!=( const common_iterator& x, const common_iterator<I2, S2>& y);
Effects: Equivalent to: return !(x == y);
template<SizedSentinel<I> I2, SizedSentinel<I> S2> requires SizedSentinel<S, I2> friend iter_difference_t<I2> operator-( const common_iterator& x, const common_iterator<I2, S2>& y);
Expects: x.v_­.valueless_­by_­exception() and y.v_­.valueless_­by_­exception() are each false.
Returns: 0 if i and j are each 1, and otherwise get<i>(x.v_­) - get<j>(y.v_­), where i is x.v_­.index() and j is y.v_­.index().