Blaze 3.9
UnderlyingScalar.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_TYPETRAITS_UNDERLYINGSCALAR_H_
36#define _BLAZE_MATH_TYPETRAITS_UNDERLYINGSCALAR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <blaze/util/EnableIf.h>
46
47
48namespace blaze {
49
50//=================================================================================================
51//
52// CLASS DEFINITION
53//
54//=================================================================================================
55
56//*************************************************************************************************
58template< typename, typename = void > struct UnderlyingScalarHelper;
60//*************************************************************************************************
61
62
63//*************************************************************************************************
89template< typename T >
91{
92 public:
93 //**********************************************************************************************
95 using Type = typename UnderlyingScalarHelper< RemoveCV_t<T> >::Type;
97 //**********************************************************************************************
98};
99//*************************************************************************************************
100
101
102//*************************************************************************************************
115template< typename T >
117//*************************************************************************************************
118
119
120//*************************************************************************************************
125template< typename T, typename >
126struct UnderlyingScalarHelper
127{
128 using Type = T;
129};
130
131template< typename T >
132struct UnderlyingScalarHelper< T, EnableIf_t< !IsSame_v< T, typename T::ElementType > > >
133{
134 using Type = typename UnderlyingScalarHelper< typename T::ElementType >::Type;
135};
137//*************************************************************************************************
138
139} // namespace blaze
140
141#endif
Header file for the EnableIf class template.
Header file for the IsSame and IsStrictlySame type traits.
Header file for the RemoveCV type trait.
typename UnderlyingScalar< T >::Type UnderlyingScalar_t
Auxiliary alias declaration for the UnderlyingScalar type trait.
Definition: UnderlyingScalar.h:116
constexpr bool IsSame_v
Auxiliary variable template for the IsSame type trait.
Definition: IsSame.h:159
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
Evaluation of the underlying scalar element type of a given data type.
Definition: UnderlyingScalar.h:91