35 #ifndef _BLAZE_UTIL_TYPETRAITS_HASMEMBER_H_ 36 #define _BLAZE_UTIL_TYPETRAITS_HASMEMBER_H_ 99 #define BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT( TYPE_TRAIT_NAME, MEMBER_NAME ) \ 101 template < typename TYPE1230 > \ 102 class TYPE_TRAIT_NAME##HELPER \ 105 template< typename U, U > struct Check; \ 107 struct Fallback { int MEMBER_NAME; }; \ 110 : blaze::If< blaze::IsBuiltin_v<TYPE1230>, blaze::EmptyType, TYPE1230 >::Type \ 114 template < typename U > \ 115 static blaze::FalseType test( Check<int Fallback::*, &U::MEMBER_NAME>* ); \ 117 template < typename U > \ 118 static blaze::TrueType test( ... ); \ 121 using Type = decltype( test<Derived>( nullptr ) ); \ 124 template< typename TYPE1230 > \ 125 struct TYPE_TRAIT_NAME \ 126 : public TYPE_TRAIT_NAME##HELPER<TYPE1230>::Type \ 129 template< typename TYPE1230 > \ 130 static constexpr bool TYPE_TRAIT_NAME##_v = TYPE_TRAIT_NAME<TYPE1230>::value 177 #define BLAZE_CREATE_HAS_TYPE_MEMBER_TYPE_TRAIT( TYPE_TRAIT_NAME, MEMBER_NAME ) \ 179 template < typename TYPE1231 > \ 180 struct TYPE_TRAIT_NAME##HELPER \ 183 struct Fallback { using MEMBER_NAME = int; }; \ 186 : blaze::If< blaze::IsBuiltin_v<TYPE1231>, blaze::EmptyType, TYPE1231 >::Type \ 190 template < class U > \ 191 static blaze::FalseType test( typename U::MEMBER_NAME* ); \ 193 template < typename U > \ 194 static blaze::TrueType test( U* ); \ 197 using Type = decltype( test<Derived>( nullptr ) ); \ 200 template< typename TYPE1231 > \ 201 struct TYPE_TRAIT_NAME \ 202 : public TYPE_TRAIT_NAME##HELPER<TYPE1231>::Type \ 205 template< typename TYPE1231 > \ 206 static constexpr bool TYPE_TRAIT_NAME##_v = TYPE_TRAIT_NAME<TYPE1231>::value 253 #define BLAZE_CREATE_HAS_MEMBER_TYPE_TRAIT( TYPE_TRAIT_NAME, MEMBER_NAME ) \ 255 template< typename Type1232 > \ 256 struct TYPE_TRAIT_NAME##HELPER \ 259 BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT( LOCAL_TYPE_TRAIT_1, MEMBER_NAME ); \ 260 BLAZE_CREATE_HAS_TYPE_MEMBER_TYPE_TRAIT( LOCAL_TYPE_TRAIT_2, MEMBER_NAME ); \ 263 static constexpr bool value = ( LOCAL_TYPE_TRAIT_1<Type1232>::value || \ 264 LOCAL_TYPE_TRAIT_2<Type1232>::value ); \ 267 template< typename Type1232 > \ 268 struct TYPE_TRAIT_NAME \ 269 : public blaze::BoolConstant< TYPE_TRAIT_NAME##HELPER<Type1232>::value > \ 272 template< typename Type1232 > \ 273 static constexpr bool TYPE_TRAIT_NAME##_v = TYPE_TRAIT_NAME<Type1232>::value 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.