Translations of this page?:

mismatch

Syntax:

    #include <algorithm>
    pair <input_iterator1,input_iterator2> mismatch( input_iterator1 start1, input_iterator1 end1, input_iterator2 start2 );
    pair <input_iterator1,input_iterator2> mismatch( input_iterator1 start1, input_iterator1 end1, input_iterator2 start2, BinPred p );

The mismatch() function compares the elements in the range defined by [start1,end1) to the elements in a range of the same size starting at start2.

The return value of mismatch() is either:

  • The first location where the two ranges differ.
  • If the ranges are equal, end1 and the corresponding element in second range.

If the optional binary predicate p is given, then it is used to compare elements from the two ranges.

The mismatch() algorithm runs in linear time.

Related Topics: equal, find, lexicographical_compare, search

 
• • • IndexRecent changesRSScc