Blaze 3.9
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
46#include <blaze/util/mpl/If.h>
48
49
50namespace blaze {
51
52//=================================================================================================
53//
54// CLASS DEFINITION
55//
56//=================================================================================================
57
58//*************************************************************************************************
67template< 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//*************************************************************************************************
111template< typename T >
113//*************************************************************************************************
114
115} // namespace blaze
116
117#endif
Header file for the If class template.
Utility type for generic codes.
Header file for the IsMatrix type trait.
Header file for the IsVector type trait.
Header file for the RemoveReference type trait.
typename DerestrictTrait< T >::Type DerestrictTrait_t
Auxiliary alias declaration for the DerestrictTrait type trait.
Definition: DerestrictTrait.h:112
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition: If.h:108
Evaluation of the return type of the derestrict function.
Definition: DerestrictTrait.h:69