HasMax.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_HASMAX_H_
36 #define _BLAZE_MATH_TYPETRAITS_HASMAX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
45 #include <blaze/util/Complex.h>
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 HasMaxHelper
68  : public FalseType
69 {};
71 //*************************************************************************************************
72 
73 
74 //*************************************************************************************************
79 template< typename T1, typename T2 >
80 struct HasMaxHelper< T1, T2, Void_< decltype( max( std::declval<T1>(), std::declval<T2>() ) ) > >
81  : public TrueType
82 {};
84 //*************************************************************************************************
85 
86 
87 //*************************************************************************************************
107 template< typename T1, typename T2, typename = void >
108 struct HasMax
109  : public HasMaxHelper<T1,T2>
110 {};
111 //*************************************************************************************************
112 
113 
114 //*************************************************************************************************
119 template< typename T >
120 struct HasMax< complex<T>, complex<T> >
121  : public FalseType
122 {};
124 //*************************************************************************************************
125 
126 
127 //*************************************************************************************************
132 template< typename T1, typename T2 >
133 struct HasMax< T1, T2, EnableIf_< And< IsVector<T1>, IsVector<T2> > > >
134  : public HasMax< typename T1::ElementType, typename T2::ElementType >
135 {};
137 //*************************************************************************************************
138 
139 } // namespace blaze
140 
141 #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.
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
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.
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1950
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 max() operation for the given data types.This type trait provides the information w...
Definition: HasMax.h:108
Header file for the complex data type.
Header file for the TrueType type/value trait base class.