Blaze  3.6
IsView.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_ISVIEW_H_
36 #define _BLAZE_MATH_TYPETRAITS_ISVIEW_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 IsViewHelper
62 {
63  private:
64  //**********************************************************************************************
65  static T* create();
66 
67  template< typename U >
68  static TrueType test( const View<U>* );
69 
70  template< typename U >
71  static TrueType test( const volatile View<U>* );
72 
73  static FalseType test( ... );
74  //**********************************************************************************************
75 
76  public:
77  //**********************************************************************************************
78  using Type = decltype( test( create() ) );
79  //**********************************************************************************************
80 };
82 //*************************************************************************************************
83 
84 
85 //*************************************************************************************************
116 template< typename T >
117 struct IsView
118  : public IsViewHelper<T>::Type
119 {};
120 //*************************************************************************************************
121 
122 
123 //*************************************************************************************************
128 template< typename T >
129 struct IsView<T&>
130  : public FalseType
131 {};
133 //*************************************************************************************************
134 
135 
136 //*************************************************************************************************
149 template< typename T >
150 constexpr bool IsView_v = IsView<T>::value;
151 //*************************************************************************************************
152 
153 } // namespace blaze
154 
155 #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
Header file for the View base class.
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:72
Compile time check for views.This type trait tests whether or not the given template parameter is a v...
Definition: IsView.h:117
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 IsView_v
Auxiliary variable template for the IsView type trait.The IsView_v variable template provides a conve...
Definition: IsView.h:150
Header file for the IntegralConstant class template.