IsInteger.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_UTIL_TYPETRAITS_ISINTEGER_H_
36 #define _BLAZE_UTIL_TYPETRAITS_ISINTEGER_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/util/FalseType.h>
44 #include <blaze/util/TrueType.h>
45 
46 
47 namespace blaze {
48 
49 //=================================================================================================
50 //
51 // CLASS DEFINITION
52 //
53 //=================================================================================================
54 
55 //*************************************************************************************************
79 template< typename T >
80 struct IsInteger : public FalseType
81 {
82  public:
83  //**********************************************************************************************
85  enum { value = 0 };
86  typedef FalseType Type;
88  //**********************************************************************************************
89 };
90 //*************************************************************************************************
91 
92 
93 //*************************************************************************************************
95 template<>
97 struct IsInteger<int> : public TrueType
98 {
99  public:
100  //**********************************************************************************************
101  enum { value = 1 };
102  typedef TrueType Type;
103  //**********************************************************************************************
104 };
106 //*************************************************************************************************
107 
108 
109 //*************************************************************************************************
111 template<>
113 struct IsInteger<const int> : public TrueType
114 {
115  public:
116  //**********************************************************************************************
117  enum { value = 1 };
118  typedef TrueType Type;
119  //**********************************************************************************************
120 };
122 //*************************************************************************************************
123 
124 
125 //*************************************************************************************************
127 template<>
129 struct IsInteger<volatile int> : public TrueType
130 {
131  public:
132  //**********************************************************************************************
133  enum { value = 1 };
134  typedef TrueType Type;
135  //**********************************************************************************************
136 };
138 //*************************************************************************************************
139 
140 
141 //*************************************************************************************************
143 template<>
145 struct IsInteger<const volatile int> : public TrueType
146 {
147  public:
148  //**********************************************************************************************
149  enum { value = 1 };
150  typedef TrueType Type;
151  //**********************************************************************************************
152 };
154 //*************************************************************************************************
155 
156 
157 //*************************************************************************************************
159 template<>
161 struct IsInteger<unsigned int> : public TrueType
162 {
163  public:
164  //**********************************************************************************************
165  enum { value = 1 };
166  typedef TrueType Type;
167  //**********************************************************************************************
168 };
170 //*************************************************************************************************
171 
172 
173 //*************************************************************************************************
175 template<>
177 struct IsInteger<const unsigned int> : public TrueType
178 {
179  public:
180  //**********************************************************************************************
181  enum { value = 1 };
182  typedef TrueType Type;
183  //**********************************************************************************************
184 };
186 //*************************************************************************************************
187 
188 
189 //*************************************************************************************************
191 template<>
193 struct IsInteger<volatile unsigned int> : public TrueType
194 {
195  public:
196  //**********************************************************************************************
197  enum { value = 1 };
198  typedef TrueType Type;
199  //**********************************************************************************************
200 };
202 //*************************************************************************************************
203 
204 
205 //*************************************************************************************************
207 template<>
209 struct IsInteger<const volatile unsigned int> : public TrueType
210 {
211  public:
212  //**********************************************************************************************
213  enum { value = 1 };
214  typedef TrueType Type;
215  //**********************************************************************************************
216 };
218 //*************************************************************************************************
219 
220 } // namespace blaze
221 
222 #endif
Header file for the FalseType type/value trait base class.
Compile time check for integer types.This type trait tests whether or not the given template paramete...
Definition: IsInteger.h:80
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
boost::false_type FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: FalseType.h:61
boost::true_type TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Header file for the TrueType type/value trait base class.