cppreference.com > C++ Algorithms > unique
unique
Syntax:
  #include <algorithm>
  iterator unique( iterator start, iterator end );
  iterator unique( iterator start, iterator end, BinPred p );

The unique() algorithm removes all consecutive duplicate elements from the range [start,end). If the binary predicate p is given, then it is used to test to test two elements to see if they are duplicates.

The return value of unique() is an iterator to the end of the modified range.

unique() runs in linear time.