Blaze  3.6
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>
49 
50 
51 namespace blaze {
52 
53 //=================================================================================================
54 //
55 // CLASS DEFINITION
56 //
57 //=================================================================================================
58 
59 //*************************************************************************************************
61 template< typename T > struct IsZero;
63 //*************************************************************************************************
64 
65 
66 //*************************************************************************************************
71 template< typename T
72  , typename = void >
73 struct IsZeroHelper
74  : public BoolConstant< IsStrictlyLower_v<T> && IsStrictlyUpper_v<T> >
75 {};
76 
77 template< typename T > // Type of the operand
78 struct IsZeroHelper< T, EnableIf_t< IsExpression_v<T> && !IsSame_v<T,typename T::ResultType> > >
79  : public IsZero< typename T::ResultType >::Type
80 {};
82 //*************************************************************************************************
83 
84 
85 //*************************************************************************************************
106 template< typename T >
107 struct IsZero
108  : public IsZeroHelper<T>
109 {};
110 //*************************************************************************************************
111 
112 
113 //*************************************************************************************************
118 template< typename T >
119 struct IsZero< const T >
120  : public IsZero<T>
121 {};
123 //*************************************************************************************************
124 
125 
126 //*************************************************************************************************
131 template< typename T >
132 struct IsZero< volatile T >
133  : public IsZero<T>
134 {};
136 //*************************************************************************************************
137 
138 
139 //*************************************************************************************************
144 template< typename T >
145 struct IsZero< const volatile T >
146  : public IsZero<T>
147 {};
149 //*************************************************************************************************
150 
151 
152 //*************************************************************************************************
165 template< typename T >
166 constexpr bool IsZero_v = IsZero<T>::value;
167 //*************************************************************************************************
168 
169 } // namespace blaze
170 
171 #endif
Header file for the IsSame and IsStrictlySame type traits.
Compile time check for zero vectors or matrices.This type trait tests whether or not the given templa...
Definition: IsZero.h:107
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
constexpr bool IsExpression_v
Auxiliary variable template for the IsExpression type trait.The IsExpression_v variable template prov...
Definition: IsExpression.h:130
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:166
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant alias template represents ...
Definition: IntegralConstant.h:110
Header file for the IntegralConstant class template.
Header file for the IsExpression type trait class.