13 #ifndef RANGES_V3_ALGORITHM_MAX_ELEMENT_HPP
14 #define RANGES_V3_ALGORITHM_MAX_ELEMENT_HPP
28 #include <range/v3/utility/static_const.hpp>
30 #include <range/v3/detail/prologue.hpp>
36 RANGES_FUNC_BEGIN(max_element)
39 template(
typename I,
typename S,
typename C =
less,
typename P = identity)(
40 requires forward_iterator<I> AND sentinel_for<S, I> AND
42 constexpr I RANGES_FUNC(max_element)(I
first, S last, C pred = C{}, P proj = P{})
45 for(
auto tmp = next(
first); tmp != last; ++tmp)
52 template(
typename Rng,
typename C =
less,
typename P = identity)(
53 requires forward_range<Rng> AND
55 constexpr borrowed_iterator_t<Rng>
56 RANGES_FUNC(max_element)(Rng && rng, C pred = C{}, P proj = P{})
58 return (*
this)(begin(rng), end(rng), std::move(pred), std::move(proj));
61 RANGES_FUNC_END(max_element)
65 using ranges::max_element;
70 #include <range/v3/detail/epilogue.hpp>
CPP_concept indirect_strict_weak_order
\concept indirect_strict_weak_order
Definition: concepts.hpp:689
typename Fn::template invoke< Args... > invoke
Evaluate the invocable Fn with the arguments Args.
Definition: meta.hpp:541
front< Pair > first
Retrieve the first element of the pair Pair.
Definition: meta.hpp:2251
bool_<(T::type::value< U::type::value)> less
A Boolean integral constant wrapper around true if T::type::value is less than U::type::value; false,...
Definition: meta.hpp:255