Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
typetraits
UnderlyingNumeric.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_TYPETRAITS_UNDERLYINGNUMERIC_H_
36
#define _BLAZE_MATH_TYPETRAITS_UNDERLYINGNUMERIC_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <
blaze/util/Complex.h
>
44
#include <
blaze/util/EnableIf.h
>
45
#include <
blaze/util/typetraits/IsSame.h
>
46
#include <
blaze/util/typetraits/RemoveCV.h
>
47
48
49
namespace
blaze {
50
51
//=================================================================================================
52
//
53
// CLASS DEFINITION
54
//
55
//=================================================================================================
56
57
//*************************************************************************************************
59
template
<
typename
,
typename
=
void
>
struct
UnderlyingNumericHelper1;
60
template
<
typename
,
typename
=
void
>
struct
UnderlyingNumericHelper2;
62
//*************************************************************************************************
63
64
65
//*************************************************************************************************
91
template
<
typename
T >
92
struct
UnderlyingNumeric
93
{
94
public
:
95
//**********************************************************************************************
97
using
Type
=
typename
UnderlyingNumericHelper1< RemoveCV_t<T> >
::Type
;
99
//**********************************************************************************************
100
};
101
//*************************************************************************************************
102
103
104
//*************************************************************************************************
117
template
<
typename
T >
118
using
UnderlyingNumeric_t
=
typename
UnderlyingNumeric<T>::Type
;
119
//*************************************************************************************************
120
121
122
//*************************************************************************************************
127
template
<
typename
T,
typename
>
128
struct
UnderlyingNumericHelper1
129
{
130
using
Type
=
typename
UnderlyingNumericHelper2<T>::Type;
131
};
132
133
template
<
typename
T >
134
struct
UnderlyingNumericHelper1<
complex
<T>, void >
135
{
136
using
Type =
complex<T>
;
137
};
138
139
template
<
typename
T >
140
struct
UnderlyingNumericHelper1< T,
EnableIf_t
< !
IsSame_v
< T, typename T::ElementType > > >
141
{
142
using
Type =
typename
UnderlyingNumericHelper1< typename T::ElementType >::Type;
143
};
145
//*************************************************************************************************
146
147
148
//*************************************************************************************************
153
template
<
typename
T,
typename
>
154
struct
UnderlyingNumericHelper2
155
{
156
using
Type = T;
157
};
158
159
template
<
typename
T >
160
struct
UnderlyingNumericHelper2< T,
EnableIf_t
< !
IsSame_v
< T, typename T::value_type > > >
161
{
162
using
Type =
typename
UnderlyingNumericHelper1< typename T::value_type >::Type;
163
};
165
//*************************************************************************************************
166
167
}
// namespace blaze
168
169
#endif
Complex.h
Header file for the complex data type.
EnableIf.h
Header file for the EnableIf class template.
IsSame.h
Header file for the IsSame and IsStrictlySame type traits.
RemoveCV.h
Header file for the RemoveCV type trait.
blaze::Type
complex
Complex data type of the Blaze library.
blaze::UnderlyingNumeric_t
typename UnderlyingNumeric< T >::Type UnderlyingNumeric_t
Auxiliary alias declaration for the UnderlyingNumeric type trait.
Definition
UnderlyingNumeric.h:118
blaze::IsSame_v
constexpr bool IsSame_v
Auxiliary variable template for the IsSame type trait.
Definition
IsSame.h:159
blaze::EnableIf_t
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition
EnableIf.h:138
blaze::UnderlyingNumeric
Evaluation of the underlying scalar element type of a given data type.
Definition
UnderlyingNumeric.h:93
Generated by
1.18.0