13 #ifndef TINYMPL_VARIADIC_MIN_ELEMENT_HPP
14 #define TINYMPL_VARIADIC_MIN_ELEMENT_HPP
16 #include <tinympl/variadic/at.hpp>
17 #include <type_traits>
35 template<
template<
class ... >
class Cmp, class ... Args> struct
min_element;
39 template<
template<
class ...>
class Comp,
class ... >
struct min_element_impl;
40 template<
template<
class ...>
class Comp,
class Head,
class ... Tail>
struct
41 min_element_impl<Comp, Head, Tail...> {
44 next_min = min_element_impl<Comp, Tail...>::type::value
48 this_min = ! Comp<at_t<next_min, Tail...>, Head>::type::value
52 typedef std::integral_constant < std::size_t,
55 next_min + 1 ) > type;
58 template<
template<
class ... >
class Comp, class Head> struct
59 min_element_impl<Comp, Head> {
60 typedef std::integral_constant<std::size_t, 0> type;
65 template<
template<
class ...>
class Comp,
class ... Args>
67 detail::min_element_impl<Comp, Args...>::type
73 #endif // TINYMPL_VARIADIC_MIN_ELEMENT_HPP
Compute the index of the smallest element in a sequence.
Definition: min_element.hpp:35