absl::c_is_sorted

c_is_sorted overloads

Synopses

Declared in <absl/algorithm/container.h>

Container-based version of the <algorithm> std::is_sorted() function to evaluate whether the given container is sorted in ascending order.

template<typename C>
constexpr
bool
c_is_sorted(C const& c);
» more...

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

template<
    typename C,
    typename LessThan>
constexpr
bool
c_is_sorted(
    C const& c,
    LessThan&& comp);
» more...

Return Value

  • true if c is sorted in ascending order, otherwise false.
  • true if c is sorted according to comp, otherwise false.

Parameters

NameDescription
cThe container to test.
compThe comparison used to order the elements.