16#ifndef RANGES_V3_ALGORITHM_MINMAX_ELEMENT_HPP
17#define RANGES_V3_ALGORITHM_MINMAX_ELEMENT_HPP
21#include <range/v3/algorithm/result_types.hpp>
31#include <range/v3/utility/static_const.hpp>
33#include <range/v3/detail/prologue.hpp>
40 using minmax_element_result = detail::min_max_result<I, I>;
42 RANGES_FUNC_BEGIN(minmax_element)
45 template(
typename I,
typename S,
typename C =
less,
typename P =
identity)(
48 constexpr minmax_element_result<I>
49 RANGES_FUNC(minmax_element)(I
first, S last, C pred = C{}, P proj = P{})
52 if(first == last || ++first == last)
58 while(++first != last)
91 template(
typename Rng,
typename C =
less,
typename P =
identity)(
94 constexpr minmax_element_result<borrowed_iterator_t<Rng>>
95 RANGES_FUNC(minmax_element)(Rng && rng, C pred = C{}, P proj = P{})
97 return (*
this)(begin(rng), end(rng), std::move(pred), std::move(proj));
100 RANGES_FUNC_END(minmax_element)
104 using ranges::minmax_element;
105 using ranges::minmax_element_result;
110#include <range/v3/detail/epilogue.hpp>
The forward_iterator concept.
The forward_range concept.
The indirect_strict_weak_order concept.
The sentinel_for concept.
decltype(begin(declval(Rng &))) iterator_t
Definition access.hpp:698
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
Definition adjacent_find.hpp:67
Definition identity.hpp:25
Definition comparisons.hpp:50