5 #ifndef VCCC_ALGORITHM_RANGES_MIN_HPP
6 #define VCCC_ALGORITHM_RANGES_MIN_HPP
9 #include <initializer_list>
32 template<
typename R,
typename Proj,
typename Comp,
bool = projectable<iterator_t<R>, Proj>::value >
33 struct check_range_2 : std::false_type {};
34 template<
typename R,
typename Proj,
typename Comp>
35 struct check_range_2<R, Proj, Comp, true>
37 indirect_strict_weak_order<Comp, projected<iterator_t<R>, Proj>>,
38 indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
42 struct check_range : std::false_type {};
43 template<
typename R,
typename Proj,
typename Comp>
44 struct check_range<R, Proj, Comp, true> : check_range_2<R, Proj, Comp> {};
46 template<
typename R,
typename Proj,
typename Comp>
47 constexpr range_value_t<R> min_range(R&& r, Comp comp, Proj proj, std::true_type )
const {
48 return static_cast<range_value_t<R>
>(*
ranges::min_element(r, std::ref(comp), std::ref(proj)));
51 template<
typename R,
typename Proj,
typename Comp>
52 constexpr range_value_t<R> min_range(R&& r, Comp comp, Proj proj, std::false_type )
const {
55 range_value_t<R> m(*i);
64 template<
typename T,
typename Proj = identity,
typename Comp = less,
65 std::enable_if_t<indirect_strict_weak_order<Comp, projected<const T*, Proj>>
::value,
int> = 0>
66 constexpr
const T& operator()(
const T& a,
const T& b, Comp comp = {}, Proj proj = {})
const {
70 template<
typename T,
typename Proj = identity,
typename Comp = less, std::enable_if_t<conjunction<
72 indirect_strict_weak_order<Comp, projected<const T*, Proj>>
74 constexpr T operator()(std::initializer_list<T> r, Comp comp = {}, Proj proj = {})
const {
78 template<
typename R,
typename Proj = identity,
typename Comp = less, std::enable_if_t<
79 check_range<R, Proj, Comp>
81 constexpr range_value_t<R> operator()(R&& r, Comp comp = {}, Proj proj = {})
const {
82 return this->min_range(std::forward<R>(r), std::ref(comp), std::ref(proj), forward_range<R>{});
constexpr VCCC_INLINE_OR_STATIC detail::min_niebloid min
Definition: min.hpp:90
constexpr VCCC_INLINE_OR_STATIC detail::min_element_niebloid min_element
Definition: min_element.hpp:52
constexpr invoke_result_t< F, Args... > invoke(F &&f, Args &&... args) noexcept(is_nothrow_invocable< F, Args... >::value)
Definition: invoke.hpp:38
constexpr VCCC_INLINE_OR_STATIC detail::begin_niebloid begin
returns an iterator to the beginning of a range
Definition: begin.hpp:116
constexpr VCCC_INLINE_OR_STATIC detail::end_niebloid end
returns a sentinel indicating the end of a range
Definition: end.hpp:120
#define VCCC_INLINE_OR_STATIC
Definition: inline_or_static.hpp:9
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35