Blaze  3.6
IsMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_ISMATRIX_H_
36 #define _BLAZE_MATH_TYPETRAITS_ISMATRIX_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 IsMatrixHelper
62 {
63  private:
64  //**********************************************************************************************
65  static T* create();
66 
67  template< typename MT, bool SO >
68  static TrueType test( const Matrix<MT,SO>* );
69 
70  template< typename MT, bool SO >
71  static TrueType test( const volatile Matrix<MT,SO>* );
72 
73  static FalseType test( ... );
74  //**********************************************************************************************
75 
76  public:
77  //**********************************************************************************************
78  using Type = decltype( test( create() ) );
79  //**********************************************************************************************
80 };
82 //*************************************************************************************************
83 
84 
85 //*************************************************************************************************
104 template< typename T >
105 struct IsMatrix
106  : public IsMatrixHelper<T>::Type
107 {};
108 //*************************************************************************************************
109 
110 
111 //*************************************************************************************************
116 template< typename T >
117 struct IsMatrix<T&>
118  : public FalseType
119 {};
121 //*************************************************************************************************
122 
123 
124 //*************************************************************************************************
137 template< typename T >
139 //*************************************************************************************************
140 
141 } // namespace blaze
142 
143 #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
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.The IsMatrix_v variable template provides a c...
Definition: IsMatrix.h:138
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
Compile time check for matrix types.This type trait tests whether or not the given template parameter...
Definition: IsMatrix.h:105
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for all forward declarations for expression class templates.
Header file for the IntegralConstant class template.