absl::c_partition

Container-based version of the <algorithm> std::partition() function to rearrange all elements in a container in such a way that all elements for which pred returns true precede all those for which it returns false, returning an iterator to the first element of the second group.

Synopsis

Declared in <absl/algorithm/container.h>

template<
    typename C,
    typename Pred>
constexpr
/* implementation-defined */
c_partition(
    C& c,
    Pred&& pred);

Return Value

An iterator to the first element of the second group.

Parameters

NameDescription
cThe container to partition.
predThe predicate used to partition the elements.