absl::c_max_element

c_max_element overloads

Synopses

Declared in <absl/algorithm/container.h>

Container-based version of the <algorithm> std::max_element() function to return an iterator pointing to the element with the largest value, using operator< to make the comparisons.

template<typename Sequence>
constexpr
/* implementation-defined */
c_max_element(Sequence& sequence);
» more...

Overload of c_max_element() for performing a comp comparison other than operator<.

template<
    typename Sequence,
    typename LessThan>
constexpr
/* implementation-defined */
c_max_element(
    Sequence& sequence,
    LessThan&& comp);
» more...

Return Value

  • An iterator to the largest element.
  • An iterator to the largest element under comp.

Parameters

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