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/mpl/If.h>
44 #include <blaze/util/mpl/Or.h>
47 
48 
49 namespace blaze {
50 
51 //=================================================================================================
52 //
53 // CLASS DEFINITION
54 //
55 //=================================================================================================
56 
57 //*************************************************************************************************
80 template< typename T >
82 {
83  private:
84  //**struct BuiltinOrComplex*********************************************************************
86  template< typename T2 >
87  struct BuiltinOrComplex { using Type = T2; };
89  //**********************************************************************************************
90 
91  //**struct Other********************************************************************************
93  template< typename T2 >
94  struct Other { using Type = typename UnderlyingNumeric<typename T2::ElementType>::Type; };
96  //**********************************************************************************************
97 
98  public:
99  //**********************************************************************************************
101  using Type = typename If_< Or< IsBuiltin<T>, IsComplex<T> >
102  , BuiltinOrComplex<T>
103  , Other<T>
104  >::Type;
106  //**********************************************************************************************
107 };
108 //*************************************************************************************************
109 
110 
111 //*************************************************************************************************
124 template< typename T >
126 //*************************************************************************************************
127 
128 } // namespace blaze
129 
130 #endif
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
Header file for the Or class template.
typename UnderlyingNumeric< T >::Type UnderlyingNumeric_
Auxiliary alias declaration for the UnderlyingNumeric type trait.The UnderlyingNumeric_ alias declara...
Definition: UnderlyingNumeric.h:125
Evaluation of the underlying numeric element type of a given data type.Via this type trait it is poss...
Definition: UnderlyingNumeric.h:81
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
Compile time check for complex types.This type trait tests whether or not the given template paramete...
Definition: IsComplex.h:76
Header file for the IsBuiltin type trait.
Header file for the IsComplex type trait.