Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
views
Check.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_VIEWS_CHECK_H_
36
#define _BLAZE_MATH_VIEWS_CHECK_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <
blaze/util/IntegralConstant.h
>
44
45
46
namespace
blaze {
47
48
//=================================================================================================
49
//
50
// CLASS DEFINITION
51
//
52
//=================================================================================================
53
54
//*************************************************************************************************
62
template
<
bool
C >
63
struct
Check
64
:
public
BoolConstant
<C>
65
{
66
//**Constructor*********************************************************************************
69
constexpr
Check() =
default
;
71
//**********************************************************************************************
72
};
73
//*************************************************************************************************
74
75
76
77
78
//=================================================================================================
79
//
80
// TYPE ALIASES
81
//
82
//=================================================================================================
83
84
//*************************************************************************************************
92
using
Checked
=
Check<true>
;
93
//*************************************************************************************************
94
95
96
//*************************************************************************************************
104
using
Unchecked
=
Check<false>
;
105
//*************************************************************************************************
106
107
108
109
110
//=================================================================================================
111
//
112
// GLOBAL CHECK INSTANCES
113
//
114
//=================================================================================================
115
116
//*************************************************************************************************
129
constexpr
Checked
checked
;
130
//*************************************************************************************************
131
132
133
//*************************************************************************************************
146
constexpr
Unchecked
unchecked
;
147
//*************************************************************************************************
148
149
150
151
152
//=================================================================================================
153
//
154
// UTILITY FUNCTIONS
155
//
156
//=================================================================================================
157
158
//*************************************************************************************************
165
constexpr
Checked
getCheck
() noexcept
166
{
167
return
Checked
{};
168
}
170
//*************************************************************************************************
171
172
173
//*************************************************************************************************
182
template
<
typename
... Ts >
183
constexpr
Unchecked
getCheck
(
const
Unchecked
& a,
const
Ts&... args )
noexcept
184
{
185
MAYBE_UNUSED
( a, args... );
186
return
Unchecked
{};
187
}
189
//*************************************************************************************************
190
191
192
//*************************************************************************************************
204
template
<
typename
T,
typename
... Ts >
205
constexpr
auto
getCheck
(
const
T& a,
const
Ts&... args )
noexcept
206
{
207
MAYBE_UNUSED
( a );
208
return
getCheck
( args ... );
209
}
210
//*************************************************************************************************
211
212
213
//*************************************************************************************************
224
template
<
typename
... Ts >
225
constexpr
bool
isChecked
(
const
Ts&... args )
226
{
227
return
getCheck
( args... ).value;
228
}
229
//*************************************************************************************************
230
231
}
// namespace blaze
232
233
#endif
IntegralConstant.h
Header file for the IntegralConstant class template.
blaze::MAYBE_UNUSED
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition
MaybeUnused.h:81
blaze::BoolConstant
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition
IntegralConstant.h:110
blaze::Checked
Check< true > Checked
Type of the blaze::checked instance.
Definition
Check.h:92
blaze::getCheck
constexpr auto getCheck(const T &a, const Ts &... args) noexcept
Extracting blaze::Check arguments from a given list of arguments.
Definition
Check.h:205
blaze::isChecked
constexpr bool isChecked(const Ts &... args)
Extracting blaze::Check arguments from a given list of arguments.
Definition
Check.h:225
blaze::checked
constexpr Checked checked
Global Checked instance.
Definition
Check.h:129
blaze::unchecked
constexpr Unchecked unchecked
Global Unchecked instance.
Definition
Check.h:146
blaze::Unchecked
Check< false > Unchecked
Type of the blaze::unchecked instance.
Definition
Check.h:104
blaze::Check
Template for the blaze::checked and blaze::unchecked instances.
Definition
Check.h:65
Generated by
1.18.0