Blaze  3.6
MaxSize.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_MAXSIZE_H_
36 #define _BLAZE_MATH_TYPETRAITS_MAXSIZE_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 MaxSizeHelper1;
57 template< typename, size_t, typename > struct MaxSizeHelper2;
58 
59 
60 
61 
62 //=================================================================================================
63 //
64 // TYPE DEFINITIONS
65 //
66 //=================================================================================================
67 
68 //*************************************************************************************************
72 constexpr ptrdiff_t DefaultMaxSize_v = -1L;
73 //*************************************************************************************************
74 
75 
76 //*************************************************************************************************
81 //*************************************************************************************************
82 
83 
84 
85 
86 //=================================================================================================
87 //
88 // CLASS DEFINITION
89 //
90 //=================================================================================================
91 
92 //*************************************************************************************************
115 template< typename T, size_t N >
116 struct MaxSize
117  : public MaxSizeHelper1<T,N>
118 {};
119 //*************************************************************************************************
120 
121 
122 //*************************************************************************************************
127 template< typename T, size_t N >
128 struct MaxSize< const T, N >
129  : public MaxSize<T,N>
130 {};
132 //*************************************************************************************************
133 
134 
135 //*************************************************************************************************
140 template< typename T, size_t N >
141 struct MaxSize< volatile T, N >
142  : public MaxSize<T,N>
143 {};
145 //*************************************************************************************************
146 
147 
148 //*************************************************************************************************
153 template< typename T, size_t N >
154 struct MaxSize< const volatile T, N >
155  : public MaxSize<T,N>
156 {};
158 //*************************************************************************************************
159 
160 
161 //*************************************************************************************************
174 template< typename T, size_t N >
176 //*************************************************************************************************
177 
178 
179 //*************************************************************************************************
184 template< typename T, size_t N, typename >
185 struct MaxSizeHelper1
186  : public DefaultMaxSize
187 {};
188 
189 template< typename T, size_t N >
190 struct MaxSizeHelper1< T, N, Void_t< typename T::ResultType > >
191  : public MaxSizeHelper2<T,N,typename T::ResultType>
192 {};
194 //*************************************************************************************************
195 
196 
197 //*************************************************************************************************
202 template< typename T, size_t N, typename U >
203 struct MaxSizeHelper2
204  : public MaxSize<U,N>
205 {};
206 
207 template< typename T, size_t N >
208 struct MaxSizeHelper2<T,N,T>
209  : public DefaultMaxSize
210 {};
212 //*************************************************************************************************
213 
214 } // namespace blaze
215 
216 #endif
Pointer difference type of the Blaze library.
Header file for the Void type trait.
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: MaxSize.h:56
constexpr ptrdiff_t DefaultMaxSize_v
Default size of the MaxSize type trait.
Definition: MaxSize.h:72
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Definition: MaxSize.h:57
Compile time evaluation of the maximum size of vectors and matrices.The MaxSize type trait evaluates ...
Definition: MaxSize.h:116
constexpr ptrdiff_t MaxSize_v
Auxiliary variable template for the MaxSize type trait.The MaxSize_v variable template provides a con...
Definition: MaxSize.h:175
Ptrdiff_t< DefaultMaxSize_v > DefaultMaxSize
Type representation of the default size of the MaxSize type trait.
Definition: MaxSize.h:80
Header file for the IntegralConstant class template.