All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 //*************************************************************************************************
74 template< typename T >
76 {
77  private:
78  //**struct Builtin******************************************************************************
80  template< typename T2 >
81  struct Builtin { typedef T2 Type; };
83  //**********************************************************************************************
84 
85  //**struct Complex******************************************************************************
87  template< typename T2 >
88  struct Complex { typedef typename BaseElementType<typename T2::value_type>::Type Type; };
90  //**********************************************************************************************
91 
92  //**struct Other********************************************************************************
94  template< typename T2 >
95  struct Other { typedef typename BaseElementType<typename T2::ElementType>::Type Type; };
97  //**********************************************************************************************
98 
99  public:
100  //**********************************************************************************************
102  typedef typename If< IsBuiltin<T>
103  , Builtin<T>
104  , typename If< IsComplex<T>
105  , Complex<T>
106  , Other<T>
107  >::Type
108  >::Type::Type Type;
110  //**********************************************************************************************
111 };
112 //*************************************************************************************************
113 
114 } // namespace blaze
115 
116 #endif
Compile time type selection.The If class template selects one of the two given types T2 and T3 depend...
Definition: If.h:112
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:75
Header file for the IsBuiltin type trait.
Header file for the IsComplex type trait.