TypeAt.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_UTIL_TYPELIST_TYPEAT_H_
36 #define _BLAZE_UTIL_TYPELIST_TYPEAT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/util/InvalidType.h>
44 #include <blaze/util/mpl/SizeT.h>
46 #include <blaze/util/Types.h>
47 
48 
49 namespace blaze {
50 
51 //=================================================================================================
52 //
53 // CLASS DEFINITION
54 //
55 //=================================================================================================
56 
57 //*************************************************************************************************
74 template< typename TL // Type of the type list
75  , size_t Index > // Type list access index
76 struct TypeAt;
77 //*************************************************************************************************
78 
79 
80 //*************************************************************************************************
85 template< typename T // Type at the head of the type list
86  , typename... Ts > // Types of the tail of the type list
87 struct TypeAt< TypeList<T,Ts...>, 0UL >
88 {
89  using Type = T;
90 };
92 //*************************************************************************************************
93 
94 
95 //*************************************************************************************************
100 template< size_t Index > // Type list access index
101 struct TypeAt< TypeList<>, Index >
102 {
103  using Type = INVALID_TYPE;
104 };
106 //*************************************************************************************************
107 
108 
109 //*************************************************************************************************
114 template< typename T // Type of the head of the type list
115  , typename... Ts // Types of the tail of the type list
116  , size_t Index > // Type list access index
117 struct TypeAt< TypeList<T,Ts...>, Index >
118 {
119  using Type = typename TypeAt< TypeList<Ts...>, Index-1UL >::Type;
120 };
122 //*************************************************************************************************
123 
124 } // namespace blaze
125 
126 #endif
Header file for basic type definitions.
Header file for the SizeT class template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Implementation of a type list.The TypeList class template represents a list of data types of arbitrar...
Definition: TypeList.h:119
Utility type for generic codes.
Indexing a type list.The TypeAt class can be used to access a type list at a specified position to qu...
Definition: TypeAt.h:76
Header file for the TypeList class template.