1 #ifndef VCSN_MISC_MILITARY_ORDER_HH
2 # define VCSN_MISC_MILITARY_ORDER_HH
5 # include <type_traits>
22 static auto test_size(
long) -> std::false_type;
28 : decltype(detail::test_size<T>(0))
48 template <
typename T2>
49 auto lt_(
const T2& x,
const T2& y)
const
50 ->
typename std::enable_if<has_size_member_function<T2>::value,
bool>::type
53 std::forward_as_tuple(x.size(), x) < std::forward_as_tuple(y.size(), y);
57 template <
typename T2>
58 auto lt_(
const T2& x,
const T2& y)
const
59 ->
typename std::enable_if<!has_size_member_function<T2>::value,
bool>::type
67 #endif // !VCSN_MISC_MILITARY_ORDER_HH
auto lt_(const T2 &x, const T2 &y) const -> typename std::enable_if<!has_size_member_function< T2 >::value, bool >::type
Case where T does not feature a size() member function.
static auto test_size(int) -> sfinae_true< decltype(std::declval< T >().size())>
Whether T features a size() function.
bool operator()(const T &x, const T &y) const
Military strict order predicate.
auto lt_(const T2 &x, const T2 &y) const -> typename std::enable_if< has_size_member_function< T2 >::value, bool >::type
Case where T features a size() member function.