Blaze  3.6
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 
47 namespace blaze {
48 
49 //=================================================================================================
50 //
51 // CLASS DEFINITION
52 //
53 //=================================================================================================
54 
55 //*************************************************************************************************
72 template< typename TL // Type of the type list
73  , typename T > // The type to be erased from the type list
74 struct Erase;
75 //*************************************************************************************************
76 
77 
78 //*************************************************************************************************
83 template< typename T > // The type to be erased from the type list
84 struct Erase< TypeList<>, T >
85 {
86  using Type = TypeList<>;
87 };
89 //*************************************************************************************************
90 
91 
92 //*************************************************************************************************
97 template< typename T // The type to be erased from the type list
98  , typename... Ts > // Types of the tail of the type list
99 struct Erase< TypeList<T,Ts...>, T >
100 {
101  using Type = TypeList<Ts...>;
102 };
104 //*************************************************************************************************
105 
106 
107 //*************************************************************************************************
112 template< 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
115 struct 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 //*************************************************************************************************
136 template< typename TL // Type of the type list
137  , typename T > // The type to be appended to the type list
138 using Erase_t = typename Erase<TL,T>::Type;
139 //*************************************************************************************************
140 
141 } // namespace blaze
142 
143 #endif
Erasing the first occurrence of a type from a type list.The Erase class can be used to erase the firs...
Definition: Erase.h:74
typename Erase< TL, T >::Type Erase_t
Auxiliary alias declaration for the Erase class template.The Erase_t alias declaration provides a con...
Definition: Erase.h:138
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Implementation of a type list.The TypeList class template represents a list of data types of arbitrar...
Definition: TypeList.h:119
Header file for the TypeList class template.
Header file for the Append class template.