All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DimensionOf.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_UTIL_DIMENSIONOF_H_
23 #define _BLAZE_UTIL_DIMENSIONOF_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
30 #include <blaze/util/Byte.h>
31 #include <blaze/util/Types.h>
32 
33 
34 namespace blaze {
35 
36 //=================================================================================================
37 //
38 // DIMENSIONOF FUNCTIONALITY
39 //
40 //=================================================================================================
41 
42 //*************************************************************************************************
50 template< unsigned int N >
51 struct Array {
52  byte array[N];
53 };
55 //*************************************************************************************************
56 
57 
58 //*************************************************************************************************
78 template< typename T, unsigned int N >
79 inline size_t dimensionof( T(&a)[N] )
80 {
81  return sizeof( Array<N> );
82 }
83 //*************************************************************************************************
84 
85 } // namespace blaze
86 
87 #endif