Blaze 3.9
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
48namespace blaze {
49
50//=================================================================================================
51//
52// ::blaze NAMESPACE FORWARD DECLARATIONS
53//
54//=================================================================================================
55
56template< typename, size_t, typename = void > struct MaxSizeHelper1;
57template< typename, size_t, typename > struct MaxSizeHelper2;
58
59
60
61
62//=================================================================================================
63//
64// TYPE DEFINITIONS
65//
66//=================================================================================================
67
68//*************************************************************************************************
72constexpr ptrdiff_t DefaultMaxSize_v = -1L;
73//*************************************************************************************************
74
75
76//*************************************************************************************************
81//*************************************************************************************************
82
83
84
85
86//=================================================================================================
87//
88// CLASS DEFINITION
89//
90//=================================================================================================
91
92//*************************************************************************************************
115template< typename T, size_t N >
117 : public MaxSizeHelper1<T,N>
118{};
119//*************************************************************************************************
120
121
122//*************************************************************************************************
127template< typename T, size_t N >
128struct MaxSize< const T, N >
129 : public MaxSize<T,N>
130{};
132//*************************************************************************************************
133
134
135//*************************************************************************************************
140template< typename T, size_t N >
141struct MaxSize< volatile T, N >
142 : public MaxSize<T,N>
143{};
145//*************************************************************************************************
146
147
148//*************************************************************************************************
153template< typename T, size_t N >
154struct MaxSize< const volatile T, N >
155 : public MaxSize<T,N>
156{};
158//*************************************************************************************************
159
160
161//*************************************************************************************************
174template< typename T, size_t N >
175constexpr ptrdiff_t MaxSize_v = MaxSize<T,N>::value;
176//*************************************************************************************************
177
178
179//*************************************************************************************************
184template< typename T, size_t N, typename >
185struct MaxSizeHelper1
186 : public DefaultMaxSize
187{};
188
189template< typename T, size_t N >
190struct MaxSizeHelper1< T, N, Void_t< typename T::ResultType > >
191 : public MaxSizeHelper2<T,N,typename T::ResultType>
192{};
194//*************************************************************************************************
195
196
197//*************************************************************************************************
202template< typename T, size_t N, typename U >
203struct MaxSizeHelper2
204 : public MaxSize<U,N>
205{};
206
207template< typename T, size_t N >
208struct MaxSizeHelper2<T,N,T>
209 : public DefaultMaxSize
210{};
212//*************************************************************************************************
213
214} // namespace blaze
215
216#endif
Header file for the IntegralConstant class template.
constexpr ptrdiff_t DefaultMaxSize_v
Default size of the MaxSize type trait.
Definition: MaxSize.h:72
constexpr ptrdiff_t MaxSize_v
Auxiliary variable template for the MaxSize type trait.
Definition: MaxSize.h:175
Ptrdiff_t< DefaultMaxSize_v > DefaultMaxSize
Type representation of the default size of the MaxSize type trait.
Definition: MaxSize.h:80
void Void_t
Compile time type check.
Definition: Void.h:64
Generic wrapper for a compile time constant integral value.
Definition: IntegralConstant.h:74
Definition: MaxSize.h:56
Definition: MaxSize.h:57
Compile time evaluation of the maximum size of vectors and matrices.
Definition: MaxSize.h:118
Header file for the Void type trait.
Header file for basic type definitions.