35 #ifndef _BLAZE_UTIL_TYPETRAITS_HASMEMBER_H_ 36 #define _BLAZE_UTIL_TYPETRAITS_HASMEMBER_H_ 101 #define BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT( TYPE_TRAIT_NAME, MEMBER_NAME ) \ 103 template < typename TYPE1230 > \ 104 class TYPE_TRAIT_NAME##HELPER \ 107 template< typename U, U > struct Check; \ 109 struct Fallback { int MEMBER_NAME; }; \ 112 : blaze::If< blaze::IsBuiltin_v<TYPE1230>, blaze::EmptyType, TYPE1230 >::Type \ 116 template < typename U > \ 117 static blaze::FalseType test( Check<int Fallback::*, &U::MEMBER_NAME>* ); \ 119 template < typename U > \ 120 static blaze::TrueType test( ... ); \ 123 using Type = decltype( test<Derived>( nullptr ) ); \ 126 template< typename TYPE1230 > \ 127 struct TYPE_TRAIT_NAME \ 128 : public TYPE_TRAIT_NAME##HELPER<TYPE1230>::Type \ 131 template< typename TYPE1230 > \ 132 static constexpr bool TYPE_TRAIT_NAME##_v = TYPE_TRAIT_NAME<TYPE1230>::value 179 #define BLAZE_CREATE_HAS_TYPE_MEMBER_TYPE_TRAIT( TYPE_TRAIT_NAME, MEMBER_NAME ) \ 181 template < typename TYPE1231 > \ 182 struct TYPE_TRAIT_NAME##HELPER \ 185 struct Fallback { using MEMBER_NAME = int; }; \ 188 : blaze::If< blaze::IsBuiltin_v<TYPE1231>, blaze::EmptyType, TYPE1231 >::Type \ 192 template < class U > \ 193 static blaze::FalseType test( typename U::MEMBER_NAME* ); \ 195 template < typename U > \ 196 static blaze::TrueType test( U* ); \ 199 using Type = decltype( test<Derived>( nullptr ) ); \ 202 template< typename TYPE1231 > \ 203 struct TYPE_TRAIT_NAME \ 204 : public TYPE_TRAIT_NAME##HELPER<TYPE1231>::Type \ 207 template< typename TYPE1231 > \ 208 static constexpr bool TYPE_TRAIT_NAME##_v = TYPE_TRAIT_NAME<TYPE1231>::value 255 #define BLAZE_CREATE_HAS_MEMBER_TYPE_TRAIT( TYPE_TRAIT_NAME, MEMBER_NAME ) \ 257 template< typename Type1232 > \ 258 struct TYPE_TRAIT_NAME##HELPER \ 261 BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT( LOCAL_TYPE_TRAIT_1, MEMBER_NAME ); \ 262 BLAZE_CREATE_HAS_TYPE_MEMBER_TYPE_TRAIT( LOCAL_TYPE_TRAIT_2, MEMBER_NAME ); \ 265 static constexpr bool value = ( LOCAL_TYPE_TRAIT_1<Type1232>::value || \ 266 LOCAL_TYPE_TRAIT_2<Type1232>::value ); \ 269 template< typename Type1232 > \ 270 struct TYPE_TRAIT_NAME \ 271 : public blaze::BoolConstant< TYPE_TRAIT_NAME##HELPER<Type1232>::value > \ 274 template< typename Type1232 > \ 275 static constexpr bool TYPE_TRAIT_NAME##_v = TYPE_TRAIT_NAME<Type1232>::value Header file for the FalseType type/value trait base class.
Header file for the If class template.
Header file for the IsBuiltin type trait.
Header file for the IntegralConstant class template.
Header file for the empty type.
Header file for the TrueType type/value trait base class.