22 #ifndef _BLAZE_UTIL_TYPELIST_H_
23 #define _BLAZE_UTIL_TYPELIST_H_
130 #define BLAZE_TYPELIST_1( T1 ) \
131 TypeList< T1, NullType >
151 #define BLAZE_TYPELIST_2( T1, T2 ) \
152 TypeList< T1, BLAZE_TYPELIST_1( T2 ) >
172 #define BLAZE_TYPELIST_3( T1, T2, T3 ) \
173 TypeList< T1, BLAZE_TYPELIST_2( T2, T3 ) >
193 #define BLAZE_TYPELIST_4( T1, T2, T3, T4 ) \
194 TypeList< T1, BLAZE_TYPELIST_3( T2, T3, T4 ) >
214 #define BLAZE_TYPELIST_5( T1, T2, T3, T4, T5 ) \
215 TypeList< T1, BLAZE_TYPELIST_4( T2, T3, T4, T5 ) >
235 #define BLAZE_TYPELIST_6( T1, T2, T3, T4, T5, T6 ) \
236 TypeList< T1, BLAZE_TYPELIST_5( T2, T3, T4, T5, T6 ) >
256 #define BLAZE_TYPELIST_7( T1, T2, T3, T4, T5, T6, T7 ) \
257 TypeList< T1, BLAZE_TYPELIST_6( T2, T3, T4, T5, T6, T7 ) >
277 #define BLAZE_TYPELIST_8( T1, T2, T3, T4, T5, T6, T7, T8 ) \
278 TypeList< T1, BLAZE_TYPELIST_7( T2, T3, T4, T5, T6, T7, T8 ) >
298 #define BLAZE_TYPELIST_9( T1, T2, T3, T4, T5, T6, T7, T8, T9 ) \
299 TypeList< T1, BLAZE_TYPELIST_8( T2, T3, T4, T5, T6, T7, T8, T9 ) >
320 #define BLAZE_TYPELIST_10( T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 ) \
321 TypeList< T1, BLAZE_TYPELIST_9( T2, T3, T4, T5, T6, T7, T8, T9, T10 ) >
349 template<
typename TList >
375 template<
typename Head
377 struct Length< TypeList<Head,Tail> >
413 template<
typename TList
424 template<
typename Head
426 struct TypeAt< TypeList<Head,Tail>, 0 >
441 template<
typename Head
444 struct TypeAt< TypeList<Head,Tail>, Index >
447 typedef typename TypeAt< Tail, Index-1 >::Result Result;
483 template<
typename TList
494 template<
typename Type >
510 template<
typename Tail
512 struct Contains< TypeList<Type,Tail>, Type >
527 template<
typename Head
530 struct Contains< TypeList<Head,Tail>, Type >
572 template<
typename TList
583 template<
typename Type >
599 template<
typename Head
607 class Yes { No no[2]; };
611 static Yes test( Head );
612 static No test( ... );
613 static Type createType();
617 enum { tmp =
sizeof( test( createType() ) ) ==
sizeof( Yes ) ? 1 : 0 };
648 template<
typename TList
659 template<
typename Type >
660 struct IndexOf< NullType, Type >
675 template<
typename Tail
677 struct IndexOf< TypeList<Type,Tail>, Type >
692 template<
typename Head
695 struct IndexOf< TypeList<Head,Tail>, Type >
704 enum { value = tmp == -1 ? -1 : 1 + tmp };
734 template<
typename TList
746 struct Append< NullType, NullType >
749 typedef NullType Result;
761 template<
typename Type >
762 struct Append< NullType, Type >
777 template< typename Head
779 struct
Append< NullType, TypeList<Head,Tail> >
782 typedef TypeList<Head,Tail> Result;
794 template<
typename Head
797 struct Append< TypeList<Head,Tail>, Type >
800 typedef TypeList< Head, typename Append<Tail,Type>::Result > Result;