absl::c_minmax_element

c_minmax_element overloads

Synopses

Declared in <absl/algorithm/container.h>

Container-based version of the <algorithm> std::minmax_element() function to return a pair of iterators pointing to the elements containing the smallest and largest values, respectively, using operator< to make the comparisons.

template<typename C>
constexpr
/* implementation-defined */
c_minmax_element(C& c);
» more...

Overload of c_minmax_element() for performing comp comparisons other than operator<.

template<
    typename C,
    typename LessThan>
constexpr
/* implementation-defined */
c_minmax_element(
    C& c,
    LessThan&& comp);
» more...

Return Value

  • A pair of iterators to the smallest and largest elements.
  • A pair of iterators to the smallest and largest elements under comp.

Parameters

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