35 #ifndef _BLAZE_UTIL_TYPELIST_H_
36 #define _BLAZE_UTIL_TYPELIST_H_
149 #define BLAZE_TYPELIST_1( T1 ) \
150 TypeList< T1, NullType >
170 #define BLAZE_TYPELIST_2( T1, T2 ) \
171 TypeList< T1, BLAZE_TYPELIST_1( T2 ) >
191 #define BLAZE_TYPELIST_3( T1, T2, T3 ) \
192 TypeList< T1, BLAZE_TYPELIST_2( T2, T3 ) >
212 #define BLAZE_TYPELIST_4( T1, T2, T3, T4 ) \
213 TypeList< T1, BLAZE_TYPELIST_3( T2, T3, T4 ) >
233 #define BLAZE_TYPELIST_5( T1, T2, T3, T4, T5 ) \
234 TypeList< T1, BLAZE_TYPELIST_4( T2, T3, T4, T5 ) >
254 #define BLAZE_TYPELIST_6( T1, T2, T3, T4, T5, T6 ) \
255 TypeList< T1, BLAZE_TYPELIST_5( T2, T3, T4, T5, T6 ) >
275 #define BLAZE_TYPELIST_7( T1, T2, T3, T4, T5, T6, T7 ) \
276 TypeList< T1, BLAZE_TYPELIST_6( T2, T3, T4, T5, T6, T7 ) >
296 #define BLAZE_TYPELIST_8( T1, T2, T3, T4, T5, T6, T7, T8 ) \
297 TypeList< T1, BLAZE_TYPELIST_7( T2, T3, T4, T5, T6, T7, T8 ) >
317 #define BLAZE_TYPELIST_9( T1, T2, T3, T4, T5, T6, T7, T8, T9 ) \
318 TypeList< T1, BLAZE_TYPELIST_8( T2, T3, T4, T5, T6, T7, T8, T9 ) >
339 #define BLAZE_TYPELIST_10( T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 ) \
340 TypeList< T1, BLAZE_TYPELIST_9( T2, T3, T4, T5, T6, T7, T8, T9, T10 ) >
368 template<
typename TList >
394 template<
typename Head
396 struct Length< TypeList<Head,Tail> >
399 enum { value = 1 + Length<Tail>::value };
432 template<
typename TList
443 template<
typename Head
460 template<
size_t Index >
476 template<
typename Head
479 struct TypeAt< TypeList<Head,Tail>, Index >
482 typedef typename TypeAt< Tail, Index-1 >::Result Result;
518 template<
typename TList
529 template<
typename Type >
545 template<
typename Tail
547 struct Contains< TypeList<Type,Tail>, Type >
562 template<
typename Head
565 struct Contains< TypeList<Head,Tail>, Type >
568 enum { value = Contains<Tail,Type>::value };
607 template<
typename TList
618 template<
typename Type >
634 template<
typename Head
637 struct ContainsRelated< TypeList<Head,Tail>, Type >
642 class Yes { No no[2]; };
646 static Yes test( Head );
647 static No test( ... );
648 static Type createType();
652 enum { tmp =
sizeof( test( createType() ) ) ==
sizeof( Yes ) ? 1 : 0 };
657 enum { value = tmp == 1 ? 1 : ( ContainsRelated<Tail,Type>::value ) };
683 template<
typename TList
694 template<
typename Type >
710 template<
typename Tail
712 struct IndexOf< TypeList<Type,Tail>, Type >
727 template<
typename Head
730 struct IndexOf< TypeList<Head,Tail>, Type >
734 enum { tmp = IndexOf<Tail,Type>::value };
739 enum { value = tmp == -1 ? -1 : 1 + tmp };
769 template<
typename TList
796 template<
typename Type >
812 template< typename Head
829 template<
typename Head
832 struct Append< TypeList<Head,Tail>, Type >
835 typedef TypeList< Head, typename Append<Tail,Type>::Result > Result;
868 template<
typename TList
879 template<
typename Type >
895 template<
typename Type
912 template<
typename Head
915 struct Erase< TypeList<Head,Tail>, Type >
918 typedef TypeList<Head,typename Erase<Tail,Type>::Result> Result;
943 template<
typename TList
954 template<
typename Type >
970 template<
typename Type
987 template<
typename Head
990 struct EraseAll< TypeList<Head,Tail>, Type >
993 typedef TypeList<Head,typename EraseAll<Tail,Type>::Result> Result;
1025 template<
typename TList >
1051 template<
typename Head
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:771
Erasing the first occurrence of a type from a type list.The Erase class can be used to erase the firs...
Definition: TypeList.h:870
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:149
Implementation of a type list.The TypeList class is an implementation of a type list according to the...
Definition: TypeList.h:116
T Tail
Type of the tail of the type list.
Definition: TypeList.h:120
Calculating the length of a type list.The Length class can be used to obtain the length of a type lis...
Definition: TypeList.h:369
Indexing a type list.The TypeAt class can be used to access a type list at a specified position to qu...
Definition: TypeList.h:434
Erasing all occurrences of a type from a type list.The EraseAll class can be used to erase all occurr...
Definition: TypeList.h:945
Utility type for generic codes.The NullType class represents an invalid or terminating data type for ...
Definition: NullType.h:54
Erasing all duplicates from a type list.The Unique class can be used to erase all duplicates from a t...
Definition: TypeList.h:1026
Searching a type list.The Contains class can be used to search the type list for a particular type Ty...
Definition: TypeList.h:520
H Head
Type of the head of the type list.
Definition: TypeList.h:119
Searching a type list.The IndexOf class can be used to search the type list for a particular type Typ...
Definition: TypeList.h:685