Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
traits
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
43
#include <
blaze/math/typetraits/IsMatrix.h
>
44
#include <
blaze/math/typetraits/IsVector.h
>
45
#include <
blaze/util/InvalidType.h
>
46
#include <
blaze/util/mpl/If.h
>
47
#include <
blaze/util/typetraits/RemoveReference.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
68
struct
DerestrictTrait
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 >
112
using
DerestrictTrait_t
=
typename
DerestrictTrait<T>::Type
;
113
//*************************************************************************************************
114
115
}
// namespace blaze
116
117
#endif
If.h
Header file for the If class template.
InvalidType.h
Utility type for generic codes.
IsMatrix.h
Header file for the IsMatrix type trait.
IsVector.h
Header file for the IsVector type trait.
RemoveReference.h
Header file for the RemoveReference type trait.
blaze::Type
blaze::DerestrictTrait_t
typename DerestrictTrait< T >::Type DerestrictTrait_t
Auxiliary alias declaration for the DerestrictTrait type trait.
Definition
DerestrictTrait.h:112
blaze::IsMatrix_v
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.
Definition
IsMatrix.h:124
blaze::If_t
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition
If.h:108
blaze::DerestrictTrait
Evaluation of the return type of the derestrict function.
Definition
DerestrictTrait.h:69
Generated by
1.18.0