Blaze  3.6
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>
48 
49 
50 namespace blaze {
51 
52 //=================================================================================================
53 //
54 // CLASS DEFINITION
55 //
56 //=================================================================================================
57 
58 //*************************************************************************************************
67 template< typename T > // Type of the vector or matrix
69 {
70  private:
71  //**struct Failure******************************************************************************
73  struct Failure { using Type = INVALID_TYPE; };
75  //**********************************************************************************************
76 
77  //**struct Result*******************************************************************************
79  struct Result {
80  static T& create() noexcept;
81  using Type = decltype( derestrict( create() ) );
82  };
84  //**********************************************************************************************
85 
86  public:
87  //**********************************************************************************************
89  using Type = typename If_t< IsVector_v< RemoveReference_t<T> > || IsMatrix_v< RemoveReference_t<T> >
90  , Result
91  , Failure >::Type;
93  //**********************************************************************************************
94 };
95 //*************************************************************************************************
96 
97 
98 //*************************************************************************************************
111 template< typename T >
113 //*************************************************************************************************
114 
115 } // namespace blaze
116 
117 #endif
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias template for the If class template.The If_t alias template provides a convenient shor...
Definition: If.h:109
Header file for the IsMatrix type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
Header file for the IsVector type trait.
typename DerestrictTrait< T >::Type DerestrictTrait_t
Auxiliary alias declaration for the DerestrictTrait type trait.The DerestrictTrait_t alias declaratio...
Definition: DerestrictTrait.h:112
Utility type for generic codes.
Evaluation of the return type of the derestrict function.Via this type trait it is possible to evalua...
Definition: DerestrictTrait.h:68
Header file for the RemoveReference type trait.