cpp/algorithm/unique copy

Copies the elements from the range, to another range beginning at in such a way that there are no consecutive equal elements. Only the first element of each group of equal elements is copied.

@1@ Elements are compared using. The behavior is undefined if it is not an. @3@ Elements are compared using the given binary predicate. The behavior is undefined if it is not an equivalence relation. @2,4@ Same as, but executed according to.

Return value
Output iterator to the element past the last written element.

Complexity
For nonempty ranges, exactly applications of the corresponding predicate.

Possible implementation
See also the implementations in libstdc++ and libc++.