Blaze  3.6
HasSize.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_UTIL_TYPETRAITS_HASSIZE_H_
36 #define _BLAZE_UTIL_TYPETRAITS_HASSIZE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/util/Types.h>
45 
46 
47 namespace blaze {
48 
49 //=================================================================================================
50 //
51 // CLASS HASSIZE
52 //
53 //=================================================================================================
54 
55 //*************************************************************************************************
74 template< typename T, size_t S >
75 struct HasSize
76  : public BoolConstant< sizeof( T ) == S >
77 {};
78 //*************************************************************************************************
79 
80 
81 //*************************************************************************************************
92 template< size_t S >
93 struct HasSize<void,S>
94  : public BoolConstant< 0 == S >
95 {};
97 //*************************************************************************************************
98 
99 
100 //*************************************************************************************************
111 template< size_t S >
112 struct HasSize<const void,S>
113  : public BoolConstant< 0 == S >
114 {};
116 //*************************************************************************************************
117 
118 
119 //*************************************************************************************************
130 template< size_t S >
131 struct HasSize<volatile void,S>
132  : public BoolConstant< 0 == S >
133 {};
135 //*************************************************************************************************
136 
137 
138 //*************************************************************************************************
149 template< size_t S >
150 struct HasSize<const volatile void,S>
151  : public BoolConstant< 0 == S >
152 {};
154 //*************************************************************************************************
155 
156 
157 //*************************************************************************************************
170 template< typename T, size_t S >
172 //*************************************************************************************************
173 
174 
175 
176 
177 //=================================================================================================
178 //
179 // CLASS HAS1BYTE
180 //
181 //=================================================================================================
182 
183 //*************************************************************************************************
202 template< typename T >
203 struct Has1Byte
204  : public HasSize<T,1UL>
205 {};
206 //*************************************************************************************************
207 
208 
209 //*************************************************************************************************
222 template< typename T >
224 //*************************************************************************************************
225 
226 
227 
228 
229 //=================================================================================================
230 //
231 // CLASS HAS2BYTES
232 //
233 //=================================================================================================
234 
235 //*************************************************************************************************
254 template< typename T >
255 struct Has2Bytes
256  : public HasSize<T,2UL>
257 {};
258 //*************************************************************************************************
259 
260 
261 //*************************************************************************************************
274 template< typename T >
276 //*************************************************************************************************
277 
278 
279 
280 
281 //=================================================================================================
282 //
283 // CLASS HAS4BYTES
284 //
285 //=================================================================================================
286 
287 //*************************************************************************************************
306 template< typename T >
307 struct Has4Bytes
308  : public HasSize<T,4UL>
309 {};
310 //*************************************************************************************************
311 
312 
313 //*************************************************************************************************
326 template< typename T >
328 //*************************************************************************************************
329 
330 
331 
332 
333 //=================================================================================================
334 //
335 // CLASS HAS8BYTES
336 //
337 //=================================================================================================
338 
339 //*************************************************************************************************
358 template< typename T >
359 struct Has8Bytes
360  : public HasSize<T,8UL>
361 {};
362 //*************************************************************************************************
363 
364 
365 //*************************************************************************************************
378 template< typename T >
380 //*************************************************************************************************
381 
382 } // namespace blaze
383 
384 #endif
Header file for basic type definitions.
Compile time size check.This type trait offers the possibility to test whether a given type has a siz...
Definition: HasSize.h:203
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:72
Compile time size check.This class offers the possibility to test the size of a type at compile time....
Definition: HasSize.h:75
Compile time size check.This type trait offers the possibility to test whether a given type has a siz...
Definition: HasSize.h:255
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
constexpr bool Has2Bytes_v
Auxiliary variable template for the Has2Bytes type trait.The Has2Bytes_v variable template provides a...
Definition: HasSize.h:275
Compile time size check.This type trait offers the possibility to test whether a given type has a siz...
Definition: HasSize.h:307
constexpr bool Has1Byte_v
Auxiliary variable template for the Has1Byte type trait.The Has1Byte_v variable template provides a c...
Definition: HasSize.h:223
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant alias template represents ...
Definition: IntegralConstant.h:110
constexpr bool Has8Bytes_v
Auxiliary variable template for the Has8Bytes type trait.The Has8Bytes_v variable template provides a...
Definition: HasSize.h:379
constexpr bool Has4Bytes_v
Auxiliary variable template for the Has4Bytes type trait.The Has4Bytes_v variable template provides a...
Definition: HasSize.h:327
constexpr bool HasSize_v
Auxiliary variable template for the HasSize type trait.The HasSize_v variable template provides a con...
Definition: HasSize.h:171
Compile time size check.This type trait offers the possibility to test whether a given type has a siz...
Definition: HasSize.h:359
Header file for the IntegralConstant class template.