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 { typedef T2 Type; };
89  //**********************************************************************************************
90 
91  //**struct Other********************************************************************************
93  template< typename T2 >
94  struct Other { typedef typename UnderlyingNumeric<typename T2::ElementType>::Type Type; };
96  //**********************************************************************************************
97 
98  public:
99  //**********************************************************************************************
101  typedef typename If< Or< IsBuiltin<T>, IsComplex<T> >
102  , BuiltinOrComplex<T>
103  , Other<T>
104  >::Type::Type Type;
106  //**********************************************************************************************
107 };
108 //*************************************************************************************************
109 
110 } // namespace blaze
111 
112 #endif
Compile time type selection.The If class template selects one of the two given types T2 and T3 depend...
Definition: If.h:112
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Header file for the Or class template.
Evaluation of the underlying numeric element type of a given data type.Via this type trait it is poss...
Definition: UnderlyingNumeric.h:81
Header file for the IsNumeric type trait.
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 IsComplex type trait.