Description
unique_copy() makes a copy of its input sequence, eliminating adjacent duplicate elements. A user-defined predicate can be supplied to specify which element pairs are equal in value.
Declaration
template <class In, class Out> Out unique_copy(In, In, Out); template <class In, class Out, class BinPred> Out unique_copy(In, In, Out, BinPred);
Concept
The example sets up a vector of integers. A copy of the sequence is made with all duplicates eliminated. The input sequence in this sample is unchanged. Values in the sequence are considered equal according to their absolute magnitude. Output of the program is:
1 2 3 5 -8 13 21
Supported
Supported
Supported