All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SizeTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_UTIL_SIZETRAIT_H_
36 #define _BLAZE_UTIL_SIZETRAIT_H_
37 
38 
39 namespace blaze {
40 
41 //=================================================================================================
42 //
43 // SIZETRAITHELPER CLASS DEFINITION
44 //
45 //=================================================================================================
46 
47 //*************************************************************************************************
52 template< typename T1, typename T2, bool >
53 struct SizeTraitHelper
54 {
55  //**Type definitions****************************************************************************
56  typedef T1 Large;
57  typedef T2 Small;
58  //**********************************************************************************************
59 };
61 //*************************************************************************************************
62 
63 
64 //*************************************************************************************************
69 template< typename T1, typename T2 >
70 struct SizeTraitHelper<T1,T2,true>
71 {
72  //**Type definitions****************************************************************************
73  typedef T2 Large;
74  typedef T1 Small;
75  //**********************************************************************************************
76 };
78 //*************************************************************************************************
79 
80 
81 
82 
83 //=================================================================================================
84 //
85 // SIZETRAIT CLASS DEFINITION
86 //
87 //=================================================================================================
88 
89 //*************************************************************************************************
99 template< typename T1, typename T2 >
100 struct SizeTrait
101 {
102  private:
103  //**Type definitions****************************************************************************
105  typedef SizeTraitHelper<T1,T2,( sizeof(T2) > sizeof(T1) )> Helper;
108  //**********************************************************************************************
109 
110  public:
111  //**Type definitions****************************************************************************
113  typedef typename Helper::Large Large;
114  typedef typename Helper::Small Small;
115 
116  //**********************************************************************************************
117 };
118 //*************************************************************************************************
119 
120 } // namespace blaze
121 
122 #endif
Base template for the SizeTrait class.The SizeTrait class template evaluates the larger of the two gi...
Definition: SizeTrait.h:100