35 #ifndef _BLAZE_UTIL_TYPETRAITS_HASMEMBER_H_
36 #define _BLAZE_UTIL_TYPETRAITS_HASMEMBER_H_
98 #define BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT( TYPE_TRAIT_NAME, MEMBER_NAME ) \
100 template < typename TYPE1230 > \
101 class TYPE_TRAIT_NAME##HELPER \
104 using Yes = char[1]; \
105 using No = char[2]; \
109 template< typename U, U > struct Check; \
111 struct Fallback { int MEMBER_NAME; }; \
114 : blaze::If< blaze::IsBuiltin<TYPE1230>, Base, TYPE1230 >::Type \
118 template < typename U > \
119 static No& test( Check<int Fallback::*, &U::MEMBER_NAME>* ); \
121 template < typename U > \
122 static Yes& test( ... ); \
125 enum : bool { value = ( sizeof( test<Derived>( nullptr ) ) == sizeof( Yes ) ) }; \
128 template< typename TYPE1230 > \
129 struct TYPE_TRAIT_NAME \
130 : public blaze::BoolConstant< TYPE_TRAIT_NAME##HELPER<TYPE1230>::value > \
182 #define BLAZE_CREATE_HAS_TYPE_MEMBER_TYPE_TRAIT( TYPE_TRAIT_NAME, MEMBER_NAME ) \
184 template < typename TYPE1231 > \
185 struct TYPE_TRAIT_NAME##HELPER \
188 using Yes = char[1]; \
189 using No = char[2]; \
193 struct Fallback { struct MEMBER_NAME { }; }; \
196 : blaze::If< blaze::IsBuiltin<TYPE1231>, Base, TYPE1231 >::Type \
200 template < class U > \
201 static No& test( typename U::MEMBER_NAME* ); \
203 template < typename U > \
204 static Yes& test( U* ); \
207 enum : bool { value = ( sizeof( test<Derived>( nullptr ) ) == sizeof( Yes ) ) }; \
210 template< typename TYPE1231 > \
211 struct TYPE_TRAIT_NAME \
212 : public blaze::BoolConstant< TYPE_TRAIT_NAME##HELPER<TYPE1231>::value > \
264 #define BLAZE_CREATE_HAS_MEMBER_TYPE_TRAIT( TYPE_TRAIT_NAME, MEMBER_NAME ) \
266 template< typename Type1232 > \
267 struct TYPE_TRAIT_NAME##HELPER \
270 BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT( LOCAL_TYPE_TRAIT_1, MEMBER_NAME ); \
271 BLAZE_CREATE_HAS_TYPE_MEMBER_TYPE_TRAIT( LOCAL_TYPE_TRAIT_2, MEMBER_NAME ); \
274 static constexpr bool value = ( LOCAL_TYPE_TRAIT_1<Type1232>::value || \
275 LOCAL_TYPE_TRAIT_2<Type1232>::value ); \
278 template< typename Type1232 > \
279 struct TYPE_TRAIT_NAME \
280 : public blaze::BoolConstant< TYPE_TRAIT_NAME##HELPER<Type1232>::value > \
Header file for the If class template.
Header file for the IsBuiltin type trait.
Header file for the IntegralConstant class template.