absl::c_merge

c_merge overloads

Synopses

Declared in <absl/algorithm/container.h>

Container-based version of the <algorithm> std::merge() function to merge two sorted containers into a single sorted iterator.

template<
    typename C1,
    typename C2,
    typename OutputIterator>
constexpr
OutputIterator
c_merge(
    C1 const& c1,
    C2 const& c2,
    OutputIterator result);
» more...

Overload of c_merge() for performing a comp comparison other than the default operator<.

template<
    typename C1,
    typename C2,
    typename OutputIterator,
    typename LessThan>
constexpr
OutputIterator
c_merge(
    C1 const& c1,
    C2 const& c2,
    OutputIterator result,
    LessThan&& comp);
» more...

Return Value

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

Parameters

NameDescription
c1The first sorted container.
c2The second sorted container.
resultThe output iterator receiving the merged elements.
compThe comparison used to order the elements.