DeclIdTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_DECLIDTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_DECLIDTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
47 #include <blaze/util/InvalidType.h>
48 #include <blaze/util/mpl/If.h>
49 #include <blaze/util/mpl/Or.h>
54 
55 
56 namespace blaze {
57 
58 //=================================================================================================
59 //
60 // CLASS DEFINITION
61 //
62 //=================================================================================================
63 
64 //*************************************************************************************************
114 template< typename MT > // Type of the matrix
116 {
117  private:
118  //**********************************************************************************************
120  struct Failure { using Type = INVALID_TYPE; };
122  //**********************************************************************************************
123 
124  //**********************************************************************************************
126  struct Result { using Type = IdentityMatrix< ElementType_<MT>, StorageOrder<MT>::value >; };
128  //**********************************************************************************************
129 
130  public:
131  //**********************************************************************************************
133  using Type = typename If_< Or< IsConst<MT>, IsVolatile<MT>, IsReference<MT> >
136  , Result
137  , Failure > >::Type;
139  //**********************************************************************************************
140 };
141 //*************************************************************************************************
142 
143 
144 //*************************************************************************************************
157 template< typename MT > // Type of the matrix
159 //*************************************************************************************************
160 
161 } // namespace blaze
162 
163 #endif
Header file for auxiliary alias declarations.
Compile time check for volatile data types.The IsVolatile type trait tests whether or not the given t...
Definition: IsVolatile.h:75
Header file for the IsVolatile type trait.
Header file for all forward declarations for sparse vectors and matrices.
Header file for the IsMatrix type trait.
Header file for the Decay type trait.
Efficient implementation of an identity matrix.The IdentityMatrix class template is the representati...
Definition: Forward.h:49
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
Header file for the Or class template.
Base template for the DeclIdTrait class.
Definition: DeclIdTrait.h:115
Header file for the IsConst type trait.
Utility type for generic codes.
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
Evaluation of the storage order of a given matrix type.Via this type trait it is possible to evaluate...
Definition: StorageOrder.h:99
Header file for the IsReference type trait.
typename DeclIdTrait< MT >::Type DeclIdTrait_
Auxiliary alias declaration for the DeclIdTrait type trait.The DeclIdTrait_ alias declaration provide...
Definition: DeclIdTrait.h:158
Header file for the StorageOrder type trait.
Compile time type check.This class tests whether the given template parameter T is a reference type (...
Definition: IsReference.h:75