void unique();
void unique(not_equal_to<T> pr);
The first member function removes from the controlled sequence every element that compares equal to its preceding
element. For the iterators Pi
and Pj
designating elements at positions i
and j
, the second member function removes
every element for which i + 1 == j && pr(*Pi, *Pj)
.
In this implementation, if a translator does not support member template functions, the template:
template<class Pred>
void unique(Pred pr);
is replaced by:
void
unique
(
not_equal_to
<T> pr);
For a controlled sequence of length N
(> 0), the predicate pr(*Pi, *Pj)
is evaluated N - 1
times.