The program has the following output: 1 4 4 6 1 2 2 3 1 6 6 6 5 7 5 4 4 1 4 6 1 2 3 1 6 5 7 5 4
1 4 4 6 1 2 2 3 1 6 6 6 5 7 5 4 4 1 4 4 6 6 6 6 7 The first call of unique() removes consecutive duplicates. The second call shows the behavior of the second form and removes all the consecutive following elements of an element for which the comparison with greater yields true. For example, the first 6 is greater than the following 1, 2, 2, 3, and1, so all these elements are removed. In other words, the predicate is not used to compare an element with its predecessor; the element is compared with the previous element that was not removed (see the following description of unique_copy() for another example