24 #ifndef AMESOS2_META_HPP
25 #define AMESOS2_META_HPP
27 #include <type_traits>
29 #include "Amesos2_config.h"
50 template <
bool b1,
bool b2>
51 struct or_ :
public std::false_type {};
54 struct or_<true,b> :
public std::true_type {};
57 struct or_<b,true> :
public std::true_type {};
60 template <
bool b1,
bool b2>
61 struct and_ :
public std::false_type {};
64 struct and_<true,true> :
public std::true_type {};
71 struct not_<true> : std::false_type {};
74 struct not_<false> : std::true_type {};
82 template <
typename Head,
typename Tail>
84 typedef type_list<Head,Tail> type;
100 template <
typename T1>
102 : type_list<T1,nil_t>
105 template <
typename T1,
typename T2>
107 : type_list<T1,type_list<T2,nil_t> >
110 template <
typename T1,
typename T2,
typename T3>
112 : type_list<T1, type_list<T2, type_list<T3,nil_t> > >
115 template <
typename T1,
typename T2,
typename T3,
typename T4>
117 : type_list<T1, type_list<T2, type_list<T3, type_list<T4,nil_t> > > >
120 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
122 : type_list<T1, type_list<T2, type_list<T3, type_list<T4, type_list<T5,nil_t> > > > >
125 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
127 : type_list<T1, type_list<T2, type_list<T3, type_list<T4, type_list<T5, type_list<T6,nil_t> > > > > >
150 template <
typename list,
typename elem>
151 struct type_list_contains {
152 static const bool value = std::conditional_t<
153 std::is_same_v<typename list::head, elem>,
155 type_list_contains<typename list::tail,elem>
160 template <
typename elem>
161 struct type_list_contains<nil_t,elem> {
162 static const bool value =
false;
171 #endif // AMESOS2_META_HPP