Template:cpp/container/unique

Removes all consecutive duplicate elements from the container. Only the first element in each group of equal elements is left. The behavior is undefined if the selected comparator does not establish an equivalence relation.

@1@ Uses to compare the elements.

@2@ Uses the given binary predicate to compare the elements.

Complexity
Exactly comparisons of the elements, if the container is not empty. Otherwise, no comparison is performed.