IsDeclaration.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_ISDECLARATION_H_
36 #define _BLAZE_MATH_TYPETRAITS_ISDECLARATION_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/util/FalseType.h>
45 #include <blaze/util/TrueType.h>
46 
47 
48 namespace blaze {
49 
50 //=================================================================================================
51 //
52 // CLASS DEFINITION
53 //
54 //=================================================================================================
55 
56 //*************************************************************************************************
61 template< typename T >
62 struct IsDeclarationHelper
63 {
64  private:
65  //**********************************************************************************************
66  static T* create();
67 
68  template< typename U >
69  static TrueType test( const Declaration<U>* );
70 
71  template< typename U >
72  static TrueType test( const volatile Declaration<U>* );
73 
74  static FalseType test( ... );
75  //**********************************************************************************************
76 
77  public:
78  //**********************************************************************************************
79  using Type = decltype( test( create() ) );
80  //**********************************************************************************************
81 };
83 //*************************************************************************************************
84 
85 
86 //*************************************************************************************************
97 template< typename T >
99  : public IsDeclarationHelper<T>::Type
100 {};
101 //*************************************************************************************************
102 
103 
104 //*************************************************************************************************
109 template< typename T >
110 struct IsDeclaration<T&>
111  : public FalseType
112 {};
114 //*************************************************************************************************
115 
116 
117 //*************************************************************************************************
130 template< typename T >
132 //*************************************************************************************************
133 
134 } // namespace blaze
135 
136 #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
constexpr bool IsDeclaration_v
Auxiliary variable template for the IsDeclaration type trait.The IsDeclaration_v variable template pr...
Definition: IsDeclaration.h:131
Compile time check whether the given type is a declaration expression template.This type trait class ...
Definition: IsDeclaration.h:98
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
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
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the Declaration base class.
Header file for the TrueType type/value trait base class.