BaseElementType.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_BASEELEMENTTYPE_H_
36 #define _BLAZE_MATH_TYPETRAITS_BASEELEMENTTYPE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/util/mpl/If.h>
46 
47 
48 namespace blaze {
49 
50 //=================================================================================================
51 //
52 // CLASS DEFINITION
53 //
54 //=================================================================================================
55 
56 //*************************************************************************************************
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 BaseElementType<typename T2::value_type>::Type Type; };
95  //**********************************************************************************************
96 
97  //**struct Other********************************************************************************
99  template< typename T2 >
100  struct Other { typedef typename BaseElementType<typename T2::ElementType>::Type 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.
Evaluation of the base element type of a given data type.Via this type trait it is possible to evalua...
Definition: BaseElementType.h:80
Header file for the IsBuiltin type trait.
Header file for the IsComplex type trait.