STL: mismatch

mismatch

Compares two ranges element by element either for equality or equivalent in a sense specified by a binary predicate and locates the first position where a difference occurs.

template<class InputIterator1, class InputIterator2>
   pair<InputIterator1, InputIterator2> mismatch(
      InputIterator1 _First1, 
      InputIterator1 _Last1,
      InputIterator2 _First2
  );
template<class InputIterator1, class InputIterator2, class BinaryPredicate>
   pair<InputIterator1, InputIterator2> mismatch(
      InputIterator1 _First1, 
      InputIterator1 _Last1,
      InputIterator2 _First2
      BinaryPredicate _Comp
   );

注,第二个序列的长度一定要大于等于第一个序列长度。

原文地址:https://www.cnblogs.com/freewater/p/2947866.html