Blaze  3.6
Size.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_SIZE_H_
36 #define _BLAZE_MATH_TYPETRAITS_SIZE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/util/Types.h>
46 
47 
48 namespace blaze {
49 
50 //=================================================================================================
51 //
52 // ::blaze NAMESPACE FORWARD DECLARATIONS
53 //
54 //=================================================================================================
55 
56 template< typename, size_t, typename = void > struct SizeHelper1;
57 template< typename, size_t, typename > struct SizeHelper2;
58 
59 
60 
61 
62 //=================================================================================================
63 //
64 // TYPE DEFINITIONS
65 //
66 //=================================================================================================
67 
68 //*************************************************************************************************
72 constexpr ptrdiff_t DefaultSize_v = -1L;
73 //*************************************************************************************************
74 
75 
76 //*************************************************************************************************
81 //*************************************************************************************************
82 
83 
84 
85 
86 //=================================================================================================
87 //
88 // CLASS DEFINITION
89 //
90 //=================================================================================================
91 
92 //*************************************************************************************************
116 template< typename T, size_t N >
117 struct Size
118  : public SizeHelper1<T,N>
119 {};
120 //*************************************************************************************************
121 
122 
123 //*************************************************************************************************
128 template< typename T, size_t N >
129 struct Size< const T, N >
130  : public Size<T,N>
131 {};
133 //*************************************************************************************************
134 
135 
136 //*************************************************************************************************
141 template< typename T, size_t N >
142 struct Size< volatile T, N >
143  : public Size<T,N>
144 {};
146 //*************************************************************************************************
147 
148 
149 //*************************************************************************************************
154 template< typename T, size_t N >
155 struct Size< const volatile T, N >
156  : public Size<T,N>
157 {};
159 //*************************************************************************************************
160 
161 
162 //*************************************************************************************************
175 template< typename T, size_t N >
177 //*************************************************************************************************
178 
179 
180 //*************************************************************************************************
185 template< typename T, size_t N, typename >
186 struct SizeHelper1
187  : public DefaultSize
188 {};
189 
190 template< typename T, size_t N >
191 struct SizeHelper1< T, N, Void_t< typename T::ResultType > >
192  : public SizeHelper2<T,N,typename T::ResultType>
193 {};
195 //*************************************************************************************************
196 
197 
198 //*************************************************************************************************
203 template< typename T, size_t N, typename U >
204 struct SizeHelper2
205  : public Size<U,N>
206 {};
207 
208 template< typename T, size_t N >
209 struct SizeHelper2<T,N,T>
210  : public DefaultSize
211 {};
213 //*************************************************************************************************
214 
215 } // namespace blaze
216 
217 #endif
Pointer difference type of the Blaze library.
Header file for the Void type trait.
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.The Size_v variable template provides a convenien...
Definition: Size.h:176
Header file for basic type definitions.
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:72
void Void_t
Compile time type check.This type trait maps an arbitrary sequence of types to the type void....
Definition: Void.h:64
Definition: Size.h:57
Ptrdiff_t< DefaultSize_v > DefaultSize
Type representation of the default size of the Size type trait.
Definition: Size.h:80
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Definition: Size.h:56
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition: Size.h:72
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:117
Header file for the IntegralConstant class template.