Blaze  3.6
UnderlyingNumeric.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_UNDERLYINGNUMERIC_H_
36 #define _BLAZE_MATH_TYPETRAITS_UNDERLYINGNUMERIC_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 UnderlyingNumericHelper1;
59 template< typename, typename = void > struct UnderlyingNumericHelper2;
61 //*************************************************************************************************
62 
63 
64 //*************************************************************************************************
90 template< typename T >
92 {
93  public:
94  //**********************************************************************************************
96  using Type = typename UnderlyingNumericHelper1< RemoveCV_t<T> >::Type;
98  //**********************************************************************************************
99 };
100 //*************************************************************************************************
101 
102 
103 //*************************************************************************************************
116 template< typename T >
118 //*************************************************************************************************
119 
120 
121 //*************************************************************************************************
126 template< typename T, typename >
127 struct UnderlyingNumericHelper1
128 {
129  using Type = typename UnderlyingNumericHelper2<T>::Type;
130 };
131 
132 template< typename T >
133 struct UnderlyingNumericHelper1< complex<T>, void >
134 {
135  using Type = complex<T>;
136 };
137 
138 template< typename T >
139 struct UnderlyingNumericHelper1< T, Void_t< typename T::ElementType > >
140 {
141  using Type = typename UnderlyingNumericHelper1< typename T::ElementType >::Type;
142 };
144 //*************************************************************************************************
145 
146 
147 //*************************************************************************************************
152 template< typename T, typename >
153 struct UnderlyingNumericHelper2
154 {
155  using Type = T;
156 };
157 
158 template< typename T >
159 struct UnderlyingNumericHelper2< T, Void_t< typename T::value_type > >
160 {
161  using Type = typename UnderlyingNumericHelper1< typename T::value_type >::Type;
162 };
164 //*************************************************************************************************
165 
166 } // namespace blaze
167 
168 #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
typename UnderlyingNumeric< T >::Type UnderlyingNumeric_t
Auxiliary alias declaration for the UnderlyingNumeric type trait.The UnderlyingNumeric_t alias declar...
Definition: UnderlyingNumeric.h:117
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Evaluation of the underlying numeric element type of a given data type.This type trait evaluates the ...
Definition: UnderlyingNumeric.h:91
Header file for the complex data type.