17 #ifndef ANDROID_TRAITS_H 18 #define ANDROID_TRAITS_H 29 template <
typename T,
typename U>
36 #define TYPELIST_1(T1) TypeList<T1, NullType> 37 #define TYPELIST_2(T1, T2) TypeList<T1, TYPELIST_1(T2)> 38 #define TYPELIST_3(T1, T2, T3) TypeList<T1, TYPELIST_2(T2, T3)> 39 #define TYPELIST_4(T1, T2, T3, T4) TypeList<T1, TYPELIST_3(T2, T3, T4)> 43 template <
typename TList,
typename T>
struct IndexOf;
50 template <
typename T,
typename Tail>
55 template <
typename Head,
typename Tail,
typename T>
60 enum { value = temp == -1 ? -1 : 1 + temp };
66 template <
bool flag,
typename T,
typename U>
70 template <
typename T,
typename U>
81 unsigned char,
unsigned short,
82 unsigned int,
unsigned long int) UnsignedInts;
85 signed char,
signed short,
86 signed int,
signed long int) SignedInts;
92 float,
double,
long double) Floats;
94 template<
typename U>
struct PointerTraits {
95 enum { result =
false };
98 template<
typename U>
struct PointerTraits<U*> {
99 enum { result =
true };
100 typedef U PointeeType;
108 enum { isPointer = PointerTraits<T>::result };
109 enum { isStdArith = isStdIntegral || isStdFloat };
112 typedef typename Select<isStdArith || isPointer, T, const T&>::Result ParameterType;