HasDiv.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_HASDIV_H_
36 #define _BLAZE_MATH_TYPETRAITS_HASDIV_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
46 #include <blaze/util/EnableIf.h>
47 #include <blaze/util/FalseType.h>
48 #include <blaze/util/mpl/And.h>
49 #include <blaze/util/TrueType.h>
51 
52 
53 namespace blaze {
54 
55 //=================================================================================================
56 //
57 // CLASS DEFINITION
58 //
59 //=================================================================================================
60 
61 //*************************************************************************************************
66 template< typename T1, typename T2, typename = void >
67 struct HasDivHelper
68  : public FalseType
69 {};
71 //*************************************************************************************************
72 
73 
74 //*************************************************************************************************
79 template< typename T1, typename T2 >
80 struct HasDivHelper< T1, T2, Void_< decltype( std::declval<T1>() / std::declval<T2>() ) > >
81  : public TrueType
82 {};
84 //*************************************************************************************************
85 
86 
87 //*************************************************************************************************
106 template< typename T1, typename T2, typename = void >
107 struct HasDiv
108  : public HasDivHelper<T1,T2>
109 {};
110 //*************************************************************************************************
111 
112 
113 //*************************************************************************************************
118 template< typename T1, typename T2 >
119 struct HasDiv< T1, T2, EnableIf_< And< IsVector<T1>, IsDenseVector<T2> > > >
120  : public HasDiv< typename T1::ElementType, typename T2::ElementType >
121 {};
123 //*************************************************************************************************
124 
125 } // namespace blaze
126 
127 #endif
BoolConstant< false > FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: FalseType.h:61
Header file for the Void type trait.
Header file for the FalseType type/value trait base class.
Header file for the And class template.
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
STL namespace.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the IsVector type trait.
Header file for the EnableIf class template.
void Void_
Compile time type check.This type trait maps an arbitrary sequence of types to the type void...
Definition: Void.h:64
Availability of a division operator for the given data types.This type trait provides the information...
Definition: HasDiv.h:107
Header file for the IsDenseVector type trait.
Header file for the TrueType type/value trait base class.