Blaze  3.6
UnderlyingElement.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_UNDERLYINGELEMENT_H_
36 #define _BLAZE_MATH_TYPETRAITS_UNDERLYINGELEMENT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/util/Complex.h>
46 
47 
48 namespace blaze {
49 
50 //=================================================================================================
51 //
52 // CLASS DEFINITION
53 //
54 //=================================================================================================
55 
56 //*************************************************************************************************
58 template< typename, typename = void > struct UnderlyingElementHelper1;
59 template< typename, typename = void > struct UnderlyingElementHelper2;
61 //*************************************************************************************************
62 
63 
64 //*************************************************************************************************
92 template< typename T >
94 {
95  public:
96  //**********************************************************************************************
98  using Type = typename UnderlyingElementHelper1< RemoveCV_t<T> >::Type;
100  //**********************************************************************************************
101 };
102 //*************************************************************************************************
103 
104 
105 //*************************************************************************************************
118 template< typename T >
120 //*************************************************************************************************
121 
122 
123 //*************************************************************************************************
128 template< typename T, typename >
129 struct UnderlyingElementHelper1
130 {
131  using Type = typename UnderlyingElementHelper2<T>::Type;
132 };
133 
134 template< typename T >
135 struct UnderlyingElementHelper1< complex<T> >
136 {
137  using Type = T;
138 };
139 
140 template< typename T >
141 struct UnderlyingElementHelper1< T, Void_t< typename T::ElementType > >
142 {
143  using Type = typename T::ElementType;
144 };
146 //*************************************************************************************************
147 
148 
149 //*************************************************************************************************
154 template< typename T, typename >
155 struct UnderlyingElementHelper2
156 {
157  using Type = T;
158 };
159 
160 template< typename T >
161 struct UnderlyingElementHelper2< T, Void_t< typename T::value_type > >
162 {
163  using Type = typename T::value_type;
164 };
166 //*************************************************************************************************
167 
168 } // namespace blaze
169 
170 #endif
Header file for the Void type trait.
Header file for the RemoveCV type trait.
void Void_t
Compile time type check.This type trait maps an arbitrary sequence of types to the type void....
Definition: Void.h:64
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Evaluation of the element type of a given data type.This type trait evaluates the underlying element ...
Definition: UnderlyingElement.h:93
typename UnderlyingElement< T >::Type UnderlyingElement_t
Auxiliary alias declaration for the UnderlyingElement type trait.The UnderlyingElement_t alias declar...
Definition: UnderlyingElement.h:119
Header file for the complex data type.