Blaze  3.6
IsProxy.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_ISPROXY_H_
36 #define _BLAZE_MATH_TYPETRAITS_ISPROXY_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 IsProxyHelper
62 {
63  private:
64  //**********************************************************************************************
65  static T* create();
66 
67  template< typename PT, typename RT >
68  static TrueType test( const Proxy<PT,RT>* );
69 
70  template< typename PT, typename RT >
71  static TrueType test( const volatile Proxy<PT,RT>* );
72 
73  static FalseType test( ... );
74  //**********************************************************************************************
75 
76  public:
77  //**********************************************************************************************
78  using Type = decltype( test( create() ) );
79  //**********************************************************************************************
80 };
82 //*************************************************************************************************
83 
84 
85 //*************************************************************************************************
109 template< typename T >
110 struct IsProxy
111  : public IsProxyHelper<T>::Type
112 {};
113 //*************************************************************************************************
114 
115 
116 //*************************************************************************************************
121 template< typename T >
122 struct IsProxy<T&>
123  : public FalseType
124 {};
126 //*************************************************************************************************
127 
128 
129 //*************************************************************************************************
142 template< typename T >
143 constexpr bool IsProxy_v = IsProxy<T>::value;
144 //*************************************************************************************************
145 
146 } // namespace blaze
147 
148 #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
Compile time check for proxy types.This type trait tests whether or not the given template parameter ...
Definition: IsProxy.h:110
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 IsProxy_v
Auxiliary variable template for the IsProxy type trait.The IsProxy_v variable template provides a con...
Definition: IsProxy.h:143
Header file for the IntegralConstant class template.
Header file for all forward declarations for proxies.