All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BaseElementType.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_MATH_TYPETRAITS_BASEELEMENTTYPE_H_
23 #define _BLAZE_MATH_TYPETRAITS_BASEELEMENTTYPE_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
30 #include <blaze/util/mpl/If.h>
33 
34 
35 namespace blaze {
36 
37 //=================================================================================================
38 //
39 // CLASS DEFINITION
40 //
41 //=================================================================================================
42 
43 //*************************************************************************************************
61 template< typename T >
63 {
64  private:
65  //**struct Builtin******************************************************************************
67  template< typename T2 >
68  struct Builtin { typedef T2 Type; };
70  //**********************************************************************************************
71 
72  //**struct Complex******************************************************************************
74  template< typename T2 >
75  struct Complex { typedef typename BaseElementType<typename T2::value_type>::Type Type; };
77  //**********************************************************************************************
78 
79  //**struct Other********************************************************************************
81  template< typename T2 >
82  struct Other { typedef typename BaseElementType<typename T2::ElementType>::Type Type; };
84  //**********************************************************************************************
85 
86  public:
87  //**********************************************************************************************
89  typedef typename If< IsBuiltin<T>
90  , Builtin<T>
91  , typename If< IsComplex<T>
92  , Complex<T>
93  , Other<T>
94  >::Type
95  >::Type::Type Type;
97  //**********************************************************************************************
98 };
99 //*************************************************************************************************
100 
101 } // namespace blaze
102 
103 #endif