All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Extent.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_UTIL_TYPETRAITS_EXTENT_H_
36 #define _BLAZE_UTIL_TYPETRAITS_EXTENT_H_
37 
38 
39 namespace blaze {
40 
41 //=================================================================================================
42 //
43 // CLASS DEFINITION
44 //
45 //=================================================================================================
46 
47 //*************************************************************************************************
68 template< typename T, unsigned int N >
69 struct Extent
70 {
71  public:
72  //**********************************************************************************************
74  enum { value = 0 };
76  //**********************************************************************************************
77 };
78 //*************************************************************************************************
79 
80 
81 //*************************************************************************************************
83 template< typename T, unsigned int N >
85 struct Extent<T[],N>
86 {
87  public:
88  //**********************************************************************************************
89  enum { value = Extent<T,N-1>::value };
90  //**********************************************************************************************
91 };
93 //*************************************************************************************************
94 
95 
96 //*************************************************************************************************
98 template< typename T, unsigned int N, unsigned int E >
100 struct Extent<T[E],N>
101 {
102  public:
103  //**********************************************************************************************
104  enum { value = Extent<T,N-1>::value };
105  //**********************************************************************************************
106 };
108 //*************************************************************************************************
109 
110 
111 //*************************************************************************************************
113 template< typename T >
115 struct Extent<T[],0UL>
116 {
117  public:
118  //**********************************************************************************************
119  enum { value = 0 };
120  //**********************************************************************************************
121 };
123 //*************************************************************************************************
124 
125 
126 //*************************************************************************************************
128 template< typename T, unsigned int E >
130 struct Extent<T[E],0U>
131 {
132  public:
133  //**********************************************************************************************
134  enum { value = E };
135  //**********************************************************************************************
136 };
138 //*************************************************************************************************
139 
140 } // namespace blaze
141 
142 #endif
Compile time check for the size of array bounds.Via this type trait it is possible to query at compil...
Definition: Extent.h:69