Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
typetraits
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
43
#include <
blaze/util/IntegralConstant.h
>
44
#include <
blaze/util/Types.h
>
45
#include <
blaze/util/typetraits/Void.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
//*************************************************************************************************
80
using
DefaultMaxSize
=
Ptrdiff_t<DefaultMaxSize_v>
;
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 >
175
constexpr
ptrdiff_t
MaxSize_v
=
MaxSize<T,N>::value
;
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
IntegralConstant.h
Header file for the IntegralConstant class template.
ptrdiff_t
Pointer difference type of the Blaze library.
blaze::DefaultMaxSize_v
constexpr ptrdiff_t DefaultMaxSize_v
Default size of the MaxSize type trait.
Definition
MaxSize.h:72
blaze::MaxSize_v
constexpr ptrdiff_t MaxSize_v
Auxiliary variable template for the MaxSize type trait.
Definition
MaxSize.h:175
blaze::DefaultMaxSize
Ptrdiff_t< DefaultMaxSize_v > DefaultMaxSize
Type representation of the default size of the MaxSize type trait.
Definition
MaxSize.h:80
blaze::Void_t
void Void_t
Compile time type check.
Definition
Void.h:64
blaze::Ptrdiff_t
IntegralConstant< ptrdiff_t, N > Ptrdiff_t
Compile time integral constant wrapper for ptrdiff_t.
Definition
IntegralConstant.h:237
blaze::MaxSizeHelper1
Definition
MaxSize.h:56
blaze::MaxSizeHelper2
Definition
MaxSize.h:57
blaze::MaxSize
Compile time evaluation of the maximum size of vectors and matrices.
Definition
MaxSize.h:118
Void.h
Header file for the Void type trait.
Types.h
Header file for basic type definitions.
Generated by
1.18.0