Blaze 3.9
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
45
46
47namespace blaze {
48
49//=================================================================================================
50//
51// TYPE LIST SEARCH
52//
53//=================================================================================================
54
55//*************************************************************************************************
73template< typename TL // Type of the type list
74 , typename T > // The search type
75struct IndexOf;
76//*************************************************************************************************
77
78
79//*************************************************************************************************
84template< typename T > // The search type
85struct IndexOf< TypeList<>, T >
86 : public Size_t<1UL>
87{};
89//*************************************************************************************************
90
91
92//*************************************************************************************************
97template< typename T // The search type
98 , typename... Ts > // Types of the tail of the type list
99struct IndexOf< TypeList<T,Ts...>, T >
100 : public Size_t<0UL>
101{};
103//*************************************************************************************************
104
105
106//*************************************************************************************************
111template< 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
114struct IndexOf< TypeList<U,Ts...>, T >
115 : public Size_t< 1UL + IndexOf< TypeList<Ts...>, T >::value >
116{};
118//*************************************************************************************************
119
120
121//*************************************************************************************************
134template< typename TL // Type of the type list
135 , typename T > // The search type
137//*************************************************************************************************
138
139} // namespace blaze
140
141#endif
Header file for the IntegralConstant class template.
constexpr size_t IndexOf_v
Auxiliary variable template for the IndexOf type trait.
Definition: IndexOf.h:136
IntegralConstant< size_t, N > Size_t
Compile time integral constant wrapper for size_t.
Definition: IntegralConstant.h:258
Searching a type list.
Definition: IndexOf.h:75
Generic wrapper for a compile time constant integral value.
Definition: IntegralConstant.h:74
Implementation of a type list.
Definition: TypeList.h:120
Header file for the TypeList class template.