IsZero.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_ISZERO_H_
36 #define _BLAZE_MATH_TYPETRAITS_ISZERO_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
46 #include <blaze/util/EnableIf.h>
48 
49 
50 namespace blaze {
51 
52 //=================================================================================================
53 //
54 // CLASS DEFINITION
55 //
56 //=================================================================================================
57 
58 //*************************************************************************************************
60 template< typename T > struct IsZero;
62 //*************************************************************************************************
63 
64 
65 //*************************************************************************************************
70 template< typename T
71  , typename = void >
72 struct IsZeroHelper
73  : public BoolConstant< IsStrictlyLower_v<T> && IsStrictlyUpper_v<T> >
74 {};
75 
76 template< typename T > // Type of the operand
77 struct IsZeroHelper< T, EnableIf_t< IsExpression_v<T> > >
78  : public IsZero< typename T::ResultType >::Type
79 {};
81 //*************************************************************************************************
82 
83 
84 //*************************************************************************************************
105 template< typename T >
106 struct IsZero
107  : public IsZeroHelper<T>
108 {};
109 //*************************************************************************************************
110 
111 
112 //*************************************************************************************************
117 template< typename T >
118 struct IsZero< const T >
119  : public IsZero<T>
120 {};
122 //*************************************************************************************************
123 
124 
125 //*************************************************************************************************
130 template< typename T >
131 struct IsZero< volatile T >
132  : public IsZero<T>
133 {};
135 //*************************************************************************************************
136 
137 
138 //*************************************************************************************************
143 template< typename T >
144 struct IsZero< const volatile T >
145  : public IsZero<T>
146 {};
148 //*************************************************************************************************
149 
150 
151 //*************************************************************************************************
164 template< typename T >
165 constexpr bool IsZero_v = IsZero<T>::value;
166 //*************************************************************************************************
167 
168 } // namespace blaze
169 
170 #endif
Compile time check for zero vectors or matrices.This type trait tests whether or not the given templa...
Definition: IsZero.h:106
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the IsStrictlyUpper type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
constexpr bool IsZero_v
Auxiliary variable template for the IsZero type trait.The IsZero_v variable template provides a conve...
Definition: IsZero.h:165
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:101
constexpr bool IsExpression_v
Auxiliary variable template for the IsExpression type trait.The IsExpression_v variable template prov...
Definition: IsExpression.h:131
Header file for the IntegralConstant class template.
Header file for the IsExpression type trait class.