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