mismatch

mismatch

template<class InIt1, class InIt2>
    pair<InIt1, InIt2> mismatch(InIt1 first, InIt1 last, InIt2 x);
template<class InIt1, class InIt2, class Pred>
    pair<InIt1, InIt2> mismatch(InIt1 first, InIt1 last,
        InIt2 x, Pred pr);

The first template function determines the lowest value of N in the range [0, last1 - first1) for which the predicate !(*(first1 + N) == *(first2 + N)) is true. It then returns pair(first1 + N, first2 + N). If no such value exists, N has the value last1 - first1. The function evaluates the predicate once, at most, for each N.

The second template function behaves the same, except that the predicate is pr(*(first1 + N), *(first2 + N)).