Blaze  3.6
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>
45 #include <blaze/util/Types.h>
46 
47 
48 namespace blaze {
49 
50 //=================================================================================================
51 //
52 // CLASS DEFINITION
53 //
54 //=================================================================================================
55 
56 //*************************************************************************************************
73 template< typename TL // Type of the type list
74  , size_t Index > // Type list access index
75 struct TypeAt;
76 //*************************************************************************************************
77 
78 
79 //*************************************************************************************************
84 template< typename T // Type at the head of the type list
85  , typename... Ts > // Types of the tail of the type list
86 struct TypeAt< TypeList<T,Ts...>, 0UL >
87 {
88  using Type = T;
89 };
91 //*************************************************************************************************
92 
93 
94 //*************************************************************************************************
99 template< size_t Index > // Type list access index
100 struct TypeAt< TypeList<>, Index >
101 {
102  using Type = INVALID_TYPE;
103 };
105 //*************************************************************************************************
106 
107 
108 //*************************************************************************************************
113 template< typename T // Type of the head of the type list
114  , typename... Ts // Types of the tail of the type list
115  , size_t Index > // Type list access index
116 struct TypeAt< TypeList<T,Ts...>, Index >
117 {
118  using Type = typename TypeAt< TypeList<Ts...>, Index-1UL >::Type;
119 };
121 //*************************************************************************************************
122 
123 
124 //*************************************************************************************************
137 template< typename TL // Type of the type list
138  , size_t Index > // Type list access index
140 //*************************************************************************************************
141 
142 } // namespace blaze
143 
144 #endif
typename TypeAt< TL, Index >::Type TypeAt_t
Auxiliary alias declaration for the TypeAt class template.The TypeAt_t alias declaration provides a c...
Definition: TypeAt.h:139
Header file for basic type definitions.
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:75
Header file for the TypeList class template.