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 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 
45 
46 namespace blaze {
47 
48 //=================================================================================================
49 //
50 // CLASS DEFINITION
51 //
52 //=================================================================================================
53 
54 //*************************************************************************************************
75 template< typename T, unsigned int N >
76 struct Extent
77  : public IntegralConstant<unsigned int,0U>
78 {};
79 //*************************************************************************************************
80 
81 
82 //*************************************************************************************************
84 template< typename T, unsigned int N >
86 struct Extent<T[],N>
87  : public IntegralConstant<unsigned int,Extent<T,N-1U>::value>
88 {};
90 //*************************************************************************************************
91 
92 
93 //*************************************************************************************************
95 template< typename T, unsigned int N, unsigned int E >
97 struct Extent<T[E],N>
98  : public IntegralConstant<unsigned int,Extent<T,N-1U>::value>
99 {};
101 //*************************************************************************************************
102 
103 
104 //*************************************************************************************************
106 template< typename T >
108 struct Extent<T[],0UL>
109  : public IntegralConstant<unsigned int,0U>
110 {};
112 //*************************************************************************************************
113 
114 
115 //*************************************************************************************************
117 template< typename T, unsigned int E >
119 struct Extent<T[E],0U>
120  : public IntegralConstant<unsigned int,E>
121 {};
123 //*************************************************************************************************
124 
125 } // namespace blaze
126 
127 #endif
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Compile time check for the size of array bounds.Via this type trait it is possible to query at compil...
Definition: Extent.h:76
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the IntegralConstant class template.