absl::c_nth_element

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

Synopsis

Declared in <absl/algorithm/container.h>

template<
    typename RandomAccessContainer,
    typename LessThan>
constexpr
void
c_nth_element(
    RandomAccessContainer& sequence,
    /* implementation-defined */ nth,
    LessThan&& comp);

Parameters

NameDescription
sequenceThe container to rearrange.
nthAn iterator to the element to place in its sorted position.
compThe comparison used to order the elements.