absl::c_partition_copy

Container-based version of the <algorithm> std::partition_copy() function to partition a container's elements and return them into two iterators: one for which pred returns true, and one for which pred returns false.

Synopsis

Declared in <absl/algorithm/container.h>

template<
    typename C,
    typename OutputIterator1,
    typename OutputIterator2,
    typename Pred>
constexpr
std::pair<OutputIterator1, OutputIterator2>
c_partition_copy(
    C const& c,
    OutputIterator1 out_true,
    OutputIterator2 out_false,
    Pred&& pred);

Return Value

A pair of iterators to the ends of the out_true and out_false ranges.

Parameters

NameDescription
cThe container whose elements to copy.
out_trueThe output iterator receiving elements satisfying pred.
out_falseThe output iterator receiving elements not satisfying pred.
predThe predicate used to partition the elements.