All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IsSame.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_UTIL_TYPETRAITS_ISSAME_H_
23 #define _BLAZE_UTIL_TYPETRAITS_ISSAME_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
30 #include <blaze/util/FalseType.h>
31 #include <blaze/util/SelectType.h>
32 #include <blaze/util/TrueType.h>
34 
35 
36 namespace blaze {
37 
38 //=================================================================================================
39 //
40 // CLASS DEFINITION
41 //
42 //=================================================================================================
43 
44 //*************************************************************************************************
63 template< typename A, typename B >
64 struct IsStrictlySame : public FalseType
65 {
66  public:
67  //**********************************************************************************************
69  enum { value = 0 };
70  typedef FalseType Type;
72  //**********************************************************************************************
73 };
74 //*************************************************************************************************
75 
76 
77 //*************************************************************************************************
79 
80 template< typename T >
81 struct IsStrictlySame<T,T> : public TrueType
82 {
83  public:
84  //**********************************************************************************************
85  enum { value = 1 };
86  typedef TrueType Type;
87  //**********************************************************************************************
88 };
90 //*************************************************************************************************
91 
92 
93 
94 
95 //=================================================================================================
96 //
97 // CLASS DEFINITION
98 //
99 //=================================================================================================
100 
101 //*************************************************************************************************
106 template< typename A, typename B >
107 struct IsSameHelper
108 {
109  private:
110  //**********************************************************************************************
111  typedef typename RemoveCV<A>::Type T1;
112  typedef typename RemoveCV<B>::Type T2;
113  //**********************************************************************************************
114 
115  public:
116  //**********************************************************************************************
117  enum { value = IsStrictlySame<T1,T2>::value };
118  typedef typename IsStrictlySame<T1,T2>::Type Type;
119  //**********************************************************************************************
120 };
122 //*************************************************************************************************
123 
124 
125 //*************************************************************************************************
144 template< typename A, typename B >
145 struct IsSame : public IsSameHelper<A,B>::Type
146 {
147  public:
148  //**********************************************************************************************
150  enum { value = IsSameHelper<A,B>::value };
151  typedef typename IsSameHelper<A,B>::Type Type;
153  //**********************************************************************************************
154 };
155 //*************************************************************************************************
156 
157 } // namespace blaze
158 
159 #endif