traits.h
Go to the documentation of this file.
1 
24 #ifndef FCPP_TRAITS_H
25 #define FCPP_TRAITS_H
26 
27 #include <iterator>
28 #include <type_traits>
29 
30 namespace fcpp::traits {
31 
32 template <typename T, typename = void> struct is_additive : std::false_type {};
33 
34 template <typename T>
35 struct is_additive<T,
36  typename std::enable_if<
37  true, decltype(std::declval<T &>() + std::declval<T &>(),
38  (void)0)>::type> : std::true_type {};
39 
40 template <typename T, typename = void>
41 struct is_equality_comparable : std::false_type {};
42 
43 template <typename T>
45  T, typename std::enable_if<true, decltype(std::declval<T &>() ==
46  std::declval<T &>(),
47  (void)0)>::type>
48  : std::true_type {};
49 
50 template <typename T, typename = void>
51 struct is_less_than_comparable : std::false_type {};
52 
53 template <typename T>
55  T, typename std::enable_if<true, decltype(std::declval<T &>() <
56  std::declval<T &>(),
57  (void)0)>::type>
58  : std::true_type {};
59 
60 } // namespace fcpp::traits
61 
62 #endif // FCPP_TRAITS_H
Definition: traits.h:32
Definition: traits.h:41
Definition: traits.h:51