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/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 //*************************************************************************************************
79 template< typename T >
81 {
82  private:
83  //**struct Builtin******************************************************************************
85  template< typename T2 >
86  struct Builtin { typedef T2 Type; };
88  //**********************************************************************************************
89 
90  //**struct Complex******************************************************************************
92  template< typename T2 >
93  struct Complex { typedef typename T2::value_type Type; };
95  //**********************************************************************************************
96 
97  //**struct Other********************************************************************************
99  template< typename T2 >
100  struct Other { typedef typename T2::ElementType Type; };
102  //**********************************************************************************************
103 
104  public:
105  //**********************************************************************************************
107  typedef typename If< IsBuiltin<T>
108  , Builtin<T>
109  , typename If< IsComplex<T>
110  , Complex<T>
111  , Other<T>
112  >::Type
113  >::Type::Type Type;
115  //**********************************************************************************************
116 };
117 //*************************************************************************************************
118 
119 } // namespace blaze
120 
121 #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 element type of a given data type.Via this type trait it is possible to evaluate th...
Definition: UnderlyingElement.h:80
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
Header file for the IsBuiltin type trait.
Header file for the IsComplex type trait.