13 #ifndef TINYMPL_LEXICOGRAPHICAL_COMPARE_HPP
14 #define TINYMPL_LEXICOGRAPHICAL_COMPARE_HPP
16 #include <tinympl/as_sequence.hpp>
17 #include <tinympl/sequence.hpp>
18 #include <tinympl/less.hpp>
19 #include <type_traits>
34 template<
class SequenceA,
36 template<
class ...>
class Comparator = less>
39 as_sequence_t<SequenceB>,
46 template<
class ...>
class Comparator>
51 std::integral_constant < int,
52 ( Comparator<AHead, BHead>::type::value ?
54 Comparator<BHead, AHead>::type::value ?
56 lexicographical_compare <
62 template<
class ... As,
template<
class ...>
class Comparator>
63 struct lexicographical_compare< sequence<As...>, sequence<>, Comparator> :
64 std::integral_constant<int, 1> {};
66 template<
class ... Bs,
template<
class ...>
class Comparator>
67 struct lexicographical_compare< sequence<>, sequence<Bs...>, Comparator> :
68 std::integral_constant < int, -1 > {};
70 template<
template<
class ...>
class Comparator>
71 struct lexicographical_compare< sequence<>, sequence<>, Comparator> :
72 std::integral_constant<int, 0> {};
76 #endif // TINYMPL_LEXICOGRAPHICAL_COMPARE_HPP
Compares two sequences using the given comparator.
Definition: lexicographical_compare.hpp:37
The main sequence type.
Definition: sequence.hpp:28