IsOne.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_SHIMS_ISONE_H_
36 #define _BLAZE_MATH_SHIMS_ISONE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/util/DisableIf.h>
44 #include <blaze/util/EnableIf.h>
46 #include <blaze/util/Unused.h>
47 
48 
49 namespace blaze {
50 
51 //=================================================================================================
52 //
53 // ISONE SHIM
54 //
55 //=================================================================================================
56 
57 //*************************************************************************************************
78 template< typename Type >
79 inline typename EnableIf< IsNumeric<Type>, bool >::Type
80  isOne( const Type& v )
81 {
82  return v == Type(1);
83 }
84 //*************************************************************************************************
85 
86 
87 //*************************************************************************************************
95 template< typename Type >
96 inline typename DisableIf< IsNumeric<Type>, bool >::Type
97  isOne( const Type& v )
98 {
99  UNUSED_PARAMETER( v );
100 
101  return false;
102 }
104 //*************************************************************************************************
105 
106 } // namespace blaze
107 
108 #endif
Header file for the UNUSED_PARAMETER function template.
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the DisableIf class template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the EnableIf class template.
Header file for the IsNumeric type trait.
EnableIf< IsNumeric< Type >, bool >::Type isOne(const Type &v)
Returns whether the given value/object represents the numeric value 1.
Definition: IsOne.h:80