Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
util
typelist
IndexOf.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_UTIL_TYPELIST_INDEXOF_H_
36
#define _BLAZE_UTIL_TYPELIST_INDEXOF_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <
blaze/util/IntegralConstant.h
>
44
#include <
blaze/util/typelist/TypeList.h
>
45
46
47
namespace
blaze {
48
49
//=================================================================================================
50
//
51
// TYPE LIST SEARCH
52
//
53
//=================================================================================================
54
55
//*************************************************************************************************
73
template
<
typename
TL
// Type of the type list
74
,
typename
T >
// The search type
75
struct
IndexOf
;
76
//*************************************************************************************************
77
78
79
//*************************************************************************************************
84
template
<
typename
T >
// The search type
85
struct
IndexOf
<
TypeList
<>, T >
86
:
public
Size_t
<1UL>
87
{};
89
//*************************************************************************************************
90
91
92
//*************************************************************************************************
97
template
<
typename
T
// The search type
98
,
typename
... Ts >
// Types of the tail of the type list
99
struct
IndexOf
<
TypeList
<T,Ts...>, T >
100
:
public
Size_t
<0UL>
101
{};
103
//*************************************************************************************************
104
105
106
//*************************************************************************************************
111
template
<
typename
U
// Type of the head of the type list
112
,
typename
... Ts
// Types of the tail of the type list
113
,
typename
T >
// The search type
114
struct
IndexOf< TypeList<U,Ts...>, T >
115
:
public
Size_t
< 1UL + IndexOf< TypeList<Ts...>, T >::value >
116
{};
118
//*************************************************************************************************
119
120
121
//*************************************************************************************************
134
template
<
typename
TL
// Type of the type list
135
,
typename
T >
// The search type
136
constexpr
size_t
IndexOf_v
=
IndexOf<TL,T>::value
;
137
//*************************************************************************************************
138
139
}
// namespace blaze
140
141
#endif
IntegralConstant.h
Header file for the IntegralConstant class template.
blaze::IndexOf_v
constexpr size_t IndexOf_v
Auxiliary variable template for the IndexOf type trait.
Definition
IndexOf.h:136
blaze::Size_t
IntegralConstant< size_t, N > Size_t
Compile time integral constant wrapper for size_t.
Definition
IntegralConstant.h:258
blaze::IndexOf
Searching a type list.
Definition
IndexOf.h:75
blaze::TypeList
Implementation of a type list.
Definition
TypeList.h:120
TypeList.h
Header file for the TypeList class template.
Generated by
1.18.0