Blaze  3.6
IsExpression.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_ISEXPRESSION_H_
36 #define _BLAZE_MATH_TYPETRAITS_ISEXPRESSION_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
45 
46 
47 namespace blaze {
48 
49 //=================================================================================================
50 //
51 // CLASS DEFINITION
52 //
53 //=================================================================================================
54 
55 //*************************************************************************************************
60 template< typename T >
61 struct IsExpressionHelper
62 {
63  private:
64  //**********************************************************************************************
65  static T* create();
66 
67  template< typename U >
68  static TrueType test( const Expression<U>* );
69 
70  template< typename U >
71  static TrueType test( const volatile Expression<U>* );
72 
73  static FalseType test( ... );
74  //**********************************************************************************************
75 
76  public:
77  //**********************************************************************************************
78  using Type = decltype( test( create() ) );
79  //**********************************************************************************************
80 };
82 //*************************************************************************************************
83 
84 
85 //*************************************************************************************************
96 template< typename T >
98  : public IsExpressionHelper<T>::Type
99 {};
100 //*************************************************************************************************
101 
102 
103 //*************************************************************************************************
108 template< typename T >
109 struct IsExpression<T&>
110  : public FalseType
111 {};
113 //*************************************************************************************************
114 
115 
116 //*************************************************************************************************
129 template< typename T >
131 //*************************************************************************************************
132 
133 } // namespace blaze
134 
135 #endif
BoolConstant< false > FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: IntegralConstant.h:121
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:72
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: IntegralConstant.h:132
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 IntegralConstant class template.
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:97
Header file for the Expression base class.