adjacent_find

The function adjacent_find is used to search for two adjacent elements that are equal or equal according to the predicate argument.

  template<class ForwardIterator>
  ForwardIterator adjacent_find
  (ForwardIterator first, ForwardIterator last);
  template<class ForwardIterator, class BinaryPredicate>
  ForwardIterator adjacent_find
  (ForwardIterator first, ForwardIterator last,
  BinaryPredicate pred);
  
Remarks

Returns the iterator to the first occurrence found or to last if no occurrence is found.