absl::c_unique_copy

Overload of c_unique_copy() for using a predicate evaluation other than == for comparing uniqueness of the element values.

Synopsis

Declared in <absl/algorithm/container.h>

template<
    typename C,
    typename OutputIterator,
    typename BinaryPredicate>
constexpr
OutputIterator
c_unique_copy(
    C const& c,
    OutputIterator result,
    BinaryPredicate&& pred);

Return Value

An iterator to the end of the copied range in the output.

Parameters

NameDescription
cThe container whose elements to copy.
resultThe output iterator receiving the copied elements.
predThe binary predicate used to compare adjacent elements.