DeclIdExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_DECLIDEXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_DECLIDEXPRTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
45 #include <blaze/util/InvalidType.h>
46 #include <blaze/util/mpl/If.h>
48 
49 
50 namespace blaze {
51 
52 //=================================================================================================
53 //
54 // CLASS DEFINITION
55 //
56 //=================================================================================================
57 
58 //*************************************************************************************************
68 template< typename T > // Type of the declid operand
70 {
71  private:
72  //**struct Failure******************************************************************************
74  struct Failure { using Type = INVALID_TYPE; };
76  //**********************************************************************************************
77 
78  //**struct Result*******************************************************************************
80  struct Result { using Type = decltype( declid( std::declval<T>() ) ); };
82  //**********************************************************************************************
83 
84  public:
85  //**********************************************************************************************
87  using Type = typename If_< IsMatrix< RemoveReference_<T> >
88  , Result
89  , Failure >::Type;
91  //**********************************************************************************************
92 };
93 //*************************************************************************************************
94 
95 
96 //*************************************************************************************************
109 template< typename T > // Type of the declid operand
111 //*************************************************************************************************
112 
113 } // namespace blaze
114 
115 #endif
Evaluation of the return type of an identity declaration (declid) expression.Via this type trait it i...
Definition: DeclIdExprTrait.h:69
Header file for the IsMatrix type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
IdentityMatrix< ElementType_< MT >, SO > declid(const Matrix< MT, SO > &m)
Declares the given matrix expression m as identity matrix.
Definition: IdentityMatrix.h:1704
typename DeclIdExprTrait< T >::Type DeclIdExprTrait_
Auxiliary alias declaration for the DeclIdExprTrait class template.The DeclIdExprTrait_ alias declara...
Definition: DeclIdExprTrait.h:110
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
Header file for the RemoveReference type trait.