Go to the documentation of this file. 11 #ifndef TLX_META_HAS_METHOD_HEADER 12 #define TLX_META_HAS_METHOD_HEADER 34 #define TLX_MAKE_HAS_METHOD(Method) \ 35 template <typename Class, typename Signature> \ 36 class has_method_ ## Method; \ 38 template <typename Class, typename Return, typename... Args> \ 39 class has_method_ ## Method<Class, Return(Args...)> \ 41 template <typename C> \ 43 decltype(static_cast<Return (C::*)(Args...)>(&C::Method))); \ 44 template <typename C> \ 45 static int test(...); \ 47 static const bool value = (sizeof(test<Class>(0)) == sizeof(char)); \ 62 #define TLX_MAKE_HAS_STATIC_METHOD(Method) \ 63 template <typename Class, typename Signature> \ 64 class has_method_ ## Method; \ 66 template <typename Class, typename Return, typename... Args> \ 67 class has_method_ ## Method<Class, Return(Args...)> \ 69 template <typename C> \ 71 decltype(static_cast<Return (*)(Args...)>(&C::Method))); \ 72 template <typename C> \ 73 static int test(...); \ 75 static const bool value = (sizeof(test<Class>(0)) == sizeof(char)); \ 91 #define TLX_MAKE_HAS_TEMPLATE_METHOD(Method) \ 92 template <typename Class, typename Signature, typename... Cons> \ 93 class has_method_ ## Method; \ 95 template <typename Class, \ 96 typename Return, typename... Args, typename... Cons> \ 97 class has_method_ ## Method<Class, Return(Args...), Cons...> \ 99 template <typename C> \ 101 decltype(static_cast<Return (C::*)(Args...)>( \ 102 &C::template Method<Cons...>))); \ 103 template <typename C> \ 104 static int test(...); \ 106 static const bool value = (sizeof(test<Class>(0)) == sizeof(char)); \ 113 #endif // !TLX_META_HAS_METHOD_HEADER