Blaze 3.9
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
44
45
46namespace blaze {
47
48//=================================================================================================
49//
50// CLASS DEFINITION
51//
52//=================================================================================================
53
54//*************************************************************************************************
62template< bool C >
63struct 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//*************************************************************************************************
93//*************************************************************************************************
94
95
96//*************************************************************************************************
105//*************************************************************************************************
106
107
108
109
110//=================================================================================================
111//
112// GLOBAL CHECK INSTANCES
113//
114//=================================================================================================
115
116//*************************************************************************************************
129constexpr Checked checked;
130//*************************************************************************************************
131
132
133//*************************************************************************************************
147//*************************************************************************************************
148
149
150
151
152//=================================================================================================
153//
154// UTILITY FUNCTIONS
155//
156//=================================================================================================
157
158//*************************************************************************************************
165constexpr Checked getCheck() noexcept
166{
167 return Checked{};
168}
170//*************************************************************************************************
171
172
173//*************************************************************************************************
182template< typename... Ts >
183constexpr Unchecked getCheck( const Unchecked& a, const Ts&... args ) noexcept
184{
185 MAYBE_UNUSED( a, args... );
186 return Unchecked{};
187}
189//*************************************************************************************************
190
191
192//*************************************************************************************************
204template< typename T, typename... Ts >
205constexpr auto getCheck( const T& a, const Ts&... args ) noexcept
206{
207 MAYBE_UNUSED( a );
208 return getCheck( args ... );
209}
210//*************************************************************************************************
211
212
213//*************************************************************************************************
224template< typename... Ts >
225constexpr bool isChecked( const Ts&... args )
226{
227 return getCheck( args... ).value;
228}
229//*************************************************************************************************
230
231} // namespace blaze
232
233#endif
Header file for the IntegralConstant class template.
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Check< false > Unchecked
Type of the blaze::unchecked instance.
Definition: Check.h:104
constexpr auto getCheck(const T &a, const Ts &... args) noexcept
Extracting blaze::Check arguments from a given list of arguments.
Definition: Check.h:205
constexpr bool isChecked(const Ts &... args)
Extracting blaze::Check arguments from a given list of arguments.
Definition: Check.h:225
constexpr Checked checked
Global Checked instance.
Definition: Check.h:129
constexpr Unchecked unchecked
Global Unchecked instance.
Definition: Check.h:146
Template for the blaze::checked and blaze::unchecked instances.
Definition: Check.h:65
Generic wrapper for a compile time constant integral value.
Definition: IntegralConstant.h:74