Blaze 3.9
Erase.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_UTIL_TYPELIST_ERASE_H_
36#define _BLAZE_UTIL_TYPELIST_ERASE_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
45
46
47namespace blaze {
48
49//=================================================================================================
50//
51// CLASS DEFINITION
52//
53//=================================================================================================
54
55//*************************************************************************************************
72template< typename TL // Type of the type list
73 , typename T > // The type to be erased from the type list
74struct Erase;
75//*************************************************************************************************
76
77
78//*************************************************************************************************
83template< typename T > // The type to be erased from the type list
84struct Erase< TypeList<>, T >
85{
86 using Type = TypeList<>;
87};
89//*************************************************************************************************
90
91
92//*************************************************************************************************
97template< typename T // The type to be erased from the type list
98 , typename... Ts > // Types of the tail of the type list
99struct Erase< TypeList<T,Ts...>, T >
100{
101 using Type = TypeList<Ts...>;
102};
104//*************************************************************************************************
105
106
107//*************************************************************************************************
112template< typename U // Type of the head of the type list
113 , typename... Ts // Types of the tail of the type list
114 , typename T > // The search type
115struct Erase< TypeList<U,Ts...>, T >
116{
117 using Type = typename Append< TypeList<U>, typename Erase< TypeList<Ts...>, T >::Type >::Type;
118};
120//*************************************************************************************************
121
122
123//*************************************************************************************************
136template< typename TL // Type of the type list
137 , typename T > // The type to be appended to the type list
138using Erase_t = typename Erase<TL,T>::Type;
139//*************************************************************************************************
140
141} // namespace blaze
142
143#endif
Header file for the Append class template.
typename Erase< TL, T >::Type Erase_t
Auxiliary alias declaration for the Erase class template.
Definition: Erase.h:138
Erasing the first occurrence of a type from a type list.
Definition: Erase.h:74
Implementation of a type list.
Definition: TypeList.h:120
Header file for the TypeList class template.