[common.iter.cmp] (original) (raw)

23 Iterators library [iterators]

23.5 Iterator adaptors [predef.iterators]

23.5.4 Common iterators [iterators.common]

23.5.4.6 Comparisons [common.iter.cmp]

template<class I2, [sentinel_­for](iterator.concept.sentinel#concept:sentinel%5Ffor "23.3.4.7 Concept sentinel_­for [iterator.concept.sentinel]")<I> S2> requires [sentinel_­for](iterator.concept.sentinel#concept:sentinel%5Ffor "23.3.4.7 Concept sentinel_­for [iterator.concept.sentinel]")<S, I2> friend bool operator==( const common_iterator& x, const common_iterator<I2, S2>& y);

Preconditions: 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_­for](iterator.concept.sentinel#concept:sentinel%5Ffor "23.3.4.7 Concept sentinel_­for [iterator.concept.sentinel]")<I> S2> requires [sentinel_­for](iterator.concept.sentinel#concept:sentinel%5Ffor "23.3.4.7 Concept sentinel_­for [iterator.concept.sentinel]")<S, I2> && equality_comparable_with<I, I2> friend bool operator==( const common_iterator& x, const common_iterator<I2, S2>& y);

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<i>(x.v_­) == get<j>(y.v_­), wherei is x.v_­.index() and j is y.v_­.index().

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<i>(x.v_­) - get<j>(y.v_­), wherei is x.v_­.index() and j is y.v_­.index().