DerestrictTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_DERESTRICTTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_DERESTRICTTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
45 #include <blaze/util/InvalidType.h>
46 #include <blaze/util/mpl/If.h>
47 #include <blaze/util/mpl/Or.h>
49 
50 
51 namespace blaze {
52 
53 //=================================================================================================
54 //
55 // CLASS DEFINITION
56 //
57 //=================================================================================================
58 
59 //*************************************************************************************************
68 template< typename T > // Type of the vector or matrix
70 {
71  private:
72  //**struct Failure******************************************************************************
74  struct Failure { using Type = INVALID_TYPE; };
76  //**********************************************************************************************
77 
78  //**struct Result*******************************************************************************
80  struct Result {
81  static T& create() noexcept;
82  using Type = decltype( derestrict( create() ) );
83  };
85  //**********************************************************************************************
86 
87  public:
88  //**********************************************************************************************
91  , Result
92  , Failure >::Type;
94  //**********************************************************************************************
95 };
96 //*************************************************************************************************
97 
98 
99 //*************************************************************************************************
112 template< typename T >
114 //*************************************************************************************************
115 
116 } // namespace blaze
117 
118 #endif
typename DerestrictTrait< T >::Type DerestrictTrait_
Auxiliary alias declaration for the DerestrictTrait type trait.The DerestrictTrait_ alias declaration...
Definition: DerestrictTrait.h:113
Compile time check for matrix types.This type trait tests whether or not the given template parameter...
Definition: IsMatrix.h:103
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.
Header file for the Or class template.
Header file for the IsVector 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 return type of the derestrict function.Via this type trait it is possible to evalua...
Definition: DerestrictTrait.h:69
Header file for the RemoveReference type trait.