IsSubmatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_ISSUBMATRIX_H_
36 #define _BLAZE_MATH_TYPETRAITS_ISSUBMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <boost/type_traits/is_base_of.hpp>
45 #include <blaze/util/FalseType.h>
46 #include <blaze/util/SelectType.h>
47 #include <blaze/util/TrueType.h>
49 
50 
51 namespace blaze {
52 
53 //=================================================================================================
54 //
55 // CLASS DEFINITION
56 //
57 //=================================================================================================
58 
59 //*************************************************************************************************
64 template< typename T >
65 struct IsSubmatrixHelper
66 {
67  private:
68  //**********************************************************************************************
69  typedef typename RemoveCV<T>::Type T2;
70  //**********************************************************************************************
71 
72  public:
73  //**********************************************************************************************
74  enum { value = boost::is_base_of<Submatrix,T2>::value && !boost::is_base_of<T2,Submatrix>::value };
75  typedef typename SelectType<value,TrueType,FalseType>::Type Type;
76  //**********************************************************************************************
77 };
79 //*************************************************************************************************
80 
81 
82 //*************************************************************************************************
109 template< typename T >
110 struct IsSubmatrix : public IsSubmatrixHelper<T>::Type
111 {
112  public:
113  //**********************************************************************************************
115  enum { value = IsSubmatrixHelper<T>::value };
116  typedef typename IsSubmatrixHelper<T>::Type Type;
118  //**********************************************************************************************
119 };
120 //*************************************************************************************************
121 
122 } // namespace blaze
123 
124 #endif
Header file for the FalseType type/value trait base class.
Header file for the RemoveCV type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the SelectType class template.
Compile time check for submatrices.This type trait tests whether or not the given template parameter ...
Definition: IsSubmatrix.h:110
Header file for the Submatrix base class.
Header file for the TrueType type/value trait base class.