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 #include <blaze/util/Types.h>
45 
46 
47 namespace blaze {
48 
49 //=================================================================================================
50 //
51 // CLASS DEFINITION
52 //
53 //=================================================================================================
54 
55 //*************************************************************************************************
76 template< typename T, size_t N >
77 struct Extent
78  : public IntegralConstant<size_t,0UL>
79 {};
80 //*************************************************************************************************
81 
82 
83 //*************************************************************************************************
85 template< typename T, size_t N >
87 struct Extent<T[],N>
88  : public IntegralConstant<size_t,Extent<T,N-1UL>::value>
89 {};
91 //*************************************************************************************************
92 
93 
94 //*************************************************************************************************
96 template< typename T, size_t N, size_t E >
98 struct Extent<T[E],N>
99  : public IntegralConstant<size_t,Extent<T,N-1UL>::value>
100 {};
102 //*************************************************************************************************
103 
104 
105 //*************************************************************************************************
107 template< typename T >
109 struct Extent<T[],0UL>
110  : public IntegralConstant<size_t,0UL>
111 {};
113 //*************************************************************************************************
114 
115 
116 //*************************************************************************************************
118 template< typename T, size_t E >
120 struct Extent<T[E],0UL>
121  : public IntegralConstant<size_t,E>
122 {};
124 //*************************************************************************************************
125 
126 
127 //*************************************************************************************************
140 template< typename T, size_t N >
141 constexpr size_t Extent_v = Extent<T,N>::value;
142 //*************************************************************************************************
143 
144 } // namespace blaze
145 
146 #endif
Header file for basic type definitions.
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:77
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
constexpr size_t Extent_v
Auxiliary variable template for the Extent type trait.The Extent_v variable template provides a conve...
Definition: Extent.h:141
Header file for the IntegralConstant class template.