Blaze 3.9
UnderlyingBuiltin.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_TYPETRAITS_UNDERLYINGBUILTIN_H_
36#define _BLAZE_MATH_TYPETRAITS_UNDERLYINGBUILTIN_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 UnderlyingBuiltinHelper1;
59template< typename, typename = void > struct UnderlyingBuiltinHelper2;
61//*************************************************************************************************
62
63
64//*************************************************************************************************
90template< typename T >
92{
93 public:
94 //**********************************************************************************************
96 using Type = typename UnderlyingBuiltinHelper1< RemoveCV_t<T> >::Type;
98 //**********************************************************************************************
99};
100//*************************************************************************************************
101
102
103//*************************************************************************************************
116template< typename T >
118//*************************************************************************************************
119
120
121//*************************************************************************************************
126template< typename T, typename >
127struct UnderlyingBuiltinHelper1
128{
129 using Type = typename UnderlyingBuiltinHelper2<T>::Type;
130};
131
132template< typename T >
133struct UnderlyingBuiltinHelper1< T, EnableIf_t< !IsSame_v< T, typename T::ElementType > > >
134{
135 using Type = typename UnderlyingBuiltinHelper1< typename T::ElementType >::Type;
136};
138//*************************************************************************************************
139
140
141//*************************************************************************************************
146template< typename T, typename >
147struct UnderlyingBuiltinHelper2
148{
149 using Type = T;
150};
151
152template< typename T >
153struct UnderlyingBuiltinHelper2< T, EnableIf_t< !IsSame_v< T, typename T::value_type > > >
154{
155 using Type = typename UnderlyingBuiltinHelper1< typename T::value_type >::Type;
156};
158//*************************************************************************************************
159
160} // namespace blaze
161
162#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 UnderlyingBuiltin< T >::Type UnderlyingBuiltin_t
Auxiliary alias declaration for the UnderlyingBuiltin type trait.
Definition: UnderlyingBuiltin.h:117
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 builtin element type of a given data type.
Definition: UnderlyingBuiltin.h:92