Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
util
typelist
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/typelist/TypeList.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
139
using
TypeAt_t
=
typename
TypeAt<TL,Index>::Type
;
140
//*************************************************************************************************
141
142
}
// namespace blaze
143
144
#endif
InvalidType.h
Utility type for generic codes.
blaze::Type
blaze::TypeAt_t
typename TypeAt< TL, Index >::Type TypeAt_t
Auxiliary alias declaration for the TypeAt class template.
Definition
TypeAt.h:139
blaze::TypeAt
Indexing a type list.
Definition
TypeAt.h:75
blaze::TypeList
Implementation of a type list.
Definition
TypeList.h:120
TypeList.h
Header file for the TypeList class template.
Types.h
Header file for basic type definitions.
Generated by
1.18.0