Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
mismatch
Prototype

template<class SinglePassRange1, class SinglePassRange2>
std::pair<
    typename range_iterator<SinglePassRange1>::type,
    typename range_iterator<const SinglePassRange2>::type >
mismatch(SinglePassRange1& rng1, const SinglePassRange2& rng2);

template<class SinglePassRange1, class SinglePassRange2>
std::pair<
    typename range_iterator<const SinglePassRange1>::type,
    typename range_iterator<const SinglePassRange2>::type >
mismatch(const SinglePassRange1& rng1, const SinglePassRange2& rng2);

template<class SinglePassRange1, class SinglePassRange2>
std::pair<
    typename range_iterator<SinglePassRange1>::type,
    typename range_iterator<SinglePassRange2>::type >
mismatch(SinglePassRange1& rng1, SinglePassRange2& rng2);

template<class SinglePassRange1, class SinglePassRange2>
std::pair<
    typename range_iterator<const SinglePassRange1>::type,
    typename range_iterator<SinglePassRange2>::type >
mismatch(const SinglePassRange1& rng1, SinglePassRange2& rng2);


template<
    class SinglePassRange1,
    class SinglePassRange2,
    class BinaryPredicate
    >
std::pair<
    typename range_iterator<SinglePassRange1>::type,
    typename range_iterator<const SinglePassRange2>::type >
mismatch(SinglePassRange1& rng1, const SinglePassRange2& rng2,
         BinaryPredicate pred);

template<
    class SinglePassRange1,
    class SinglePassRange2,
    class BinaryPredicate
    >
std::pair<
    typename range_iterator<const SinglePassRange1>::type,
    typename range_iterator<const SinglePassRange2>::type >
mismatch(const SinglePassRange1& rng1, const SinglePassRange2& rng2,
         BinaryPredicate pred);

template<
    class SinglePassRange1,
    class SinglePassRange2,
    class BinaryPredicate
    >
std::pair<
    typename range_iterator<SinglePassRange1>::type,
    typename range_iterator<SinglePassRange2>::type >
mismatch(SinglePassRange1& rng1, SinglePassRange2& rng2,
         BinaryPredicate pred);

template<
    class SinglePassRange1,
    class SinglePassRange2,
    class BinaryPredicate
    >
std::pair<
    typename range_iterator<const SinglePassRange1>::type,
    typename range_iterator<SinglePassRange2>::type >
mismatch(const SinglePassRange1& rng1, SinglePassRange2& rng2,
         BinaryPredicate pred);

Description

mismatch finds the first position where the corresponding elements from the two ranges rng1 and rng2 are not equal.

Equality is determined by operator== for non-predicate versions of mismatch, and by satisfying pred in the predicate versions.

Definition

Defined in the header file boost/range/algorithm/mismatch.hpp

Requirements

For the non-predicate versions:

For the predicate versions:

Precondition:

distance(rng2) >= distance(rng1)

Complexity

Linear. At most distance(rng1) comparisons.


PrevUpHomeNext