35 #ifndef _BLAZE_UTIL_TYPELIST_H_
36 #define _BLAZE_UTIL_TYPELIST_H_
143 #define BLAZE_TYPELIST_1( T1 ) \
144 TypeList< T1, NullType >
164 #define BLAZE_TYPELIST_2( T1, T2 ) \
165 TypeList< T1, BLAZE_TYPELIST_1( T2 ) >
185 #define BLAZE_TYPELIST_3( T1, T2, T3 ) \
186 TypeList< T1, BLAZE_TYPELIST_2( T2, T3 ) >
206 #define BLAZE_TYPELIST_4( T1, T2, T3, T4 ) \
207 TypeList< T1, BLAZE_TYPELIST_3( T2, T3, T4 ) >
227 #define BLAZE_TYPELIST_5( T1, T2, T3, T4, T5 ) \
228 TypeList< T1, BLAZE_TYPELIST_4( T2, T3, T4, T5 ) >
248 #define BLAZE_TYPELIST_6( T1, T2, T3, T4, T5, T6 ) \
249 TypeList< T1, BLAZE_TYPELIST_5( T2, T3, T4, T5, T6 ) >
269 #define BLAZE_TYPELIST_7( T1, T2, T3, T4, T5, T6, T7 ) \
270 TypeList< T1, BLAZE_TYPELIST_6( T2, T3, T4, T5, T6, T7 ) >
290 #define BLAZE_TYPELIST_8( T1, T2, T3, T4, T5, T6, T7, T8 ) \
291 TypeList< T1, BLAZE_TYPELIST_7( T2, T3, T4, T5, T6, T7, T8 ) >
311 #define BLAZE_TYPELIST_9( T1, T2, T3, T4, T5, T6, T7, T8, T9 ) \
312 TypeList< T1, BLAZE_TYPELIST_8( T2, T3, T4, T5, T6, T7, T8, T9 ) >
333 #define BLAZE_TYPELIST_10( T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 ) \
334 TypeList< T1, BLAZE_TYPELIST_9( T2, T3, T4, T5, T6, T7, T8, T9, T10 ) >
362 template<
typename TList >
388 template<
typename Head
390 struct Length< TypeList<Head,Tail> >
393 enum { value = 1 + Length<Tail>::value };
426 template<
typename TList
437 template<
typename Head
454 template<
typename Head
460 typedef typename TypeAt< Tail, Index-1 >::Result Result;
496 template<
typename TList
507 template<
typename Type >
523 template<
typename Tail
525 struct Contains< TypeList<Type,Tail>, Type >
540 template<
typename Head
543 struct Contains< TypeList<Head,Tail>, Type >
546 enum { value = Contains<Tail,Type>::value };
585 template<
typename TList
596 template<
typename Type >
612 template<
typename Head
615 struct ContainsRelated< TypeList<Head,Tail>, Type >
620 class Yes { No no[2]; };
624 static Yes test( Head );
625 static No test( ... );
626 static Type createType();
630 enum { tmp =
sizeof( test( createType() ) ) ==
sizeof( Yes ) ? 1 : 0 };
635 enum { value = tmp == 1 ? 1 : ( ContainsRelated<Tail,Type>::value ) };
661 template<
typename TList
672 template<
typename Type >
688 template<
typename Tail
690 struct IndexOf< TypeList<Type,Tail>, Type >
705 template<
typename Head
708 struct IndexOf< TypeList<Head,Tail>, Type >
712 enum { tmp = IndexOf<Tail,Type>::value };
717 enum { value = tmp == -1 ? -1 : 1 + tmp };
747 template<
typename TList
774 template<
typename Type >
790 template< typename Head
807 template<
typename Head
810 struct Append< TypeList<Head,Tail>, Type >
813 typedef TypeList< Head, typename Append<Tail,Type>::Result > Result;
Header file for basic type definitions.
Utility type for generic codes.
Appending a type to a type list.The Append class can be used to append the data type Type to a type l...
Definition: TypeList.h:749
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_TYPELIST_1(T1)
Type list generation macro.This macro creates a type list only consisting of the type T1...
Definition: TypeList.h:143
Implementation of a type list.The TypeList class is an implementation of a type list according to the...
Definition: TypeList.h:110
T Tail
Type of the tail of the type list.
Definition: TypeList.h:114
Calculating the length of a type list.The Length class can be used to obtain the length of a type lis...
Definition: TypeList.h:363
Indexing a type list.The TypeAt class can be used to access a type list at a specified position to qu...
Definition: TypeList.h:428
Utility type for generic codes.The NullType class represents an invalid or terminating data type for ...
Definition: NullType.h:54
Searching a type list.The Contains class can be used to search the type list for a particular type Ty...
Definition: TypeList.h:498
H Head
Type of the head of the type list.
Definition: TypeList.h:113
Searching a type list.The IndexOf class can be used to search the type list for a particular type Typ...
Definition: TypeList.h:663