Go to the source code of this file.
#define TTK_DECLARE_CLASS_SIGNATURE |
( |
|
__trait_name__, |
|
|
|
__func_name__ |
|
) |
| |
Value:template <class Void, class Obj, class Func> \
struct __trait_name__ : std::false_type {}; \
template <class Obj, class Func> \
struct __trait_name__<std::void_t<decltype(static_cast<Func Obj::*>(&Obj::__func_name__))>, Obj, Func> : std::true_type {}; \
template <class Obj, class Func> \
using __trait_name__##
Check = __trait_name__<void, Obj, Func>;
Definition at line 46 of file traits.h.
#define TTK_DECLARE_GLOBAL_SIGNATURE |
( |
|
__trait_name__, |
|
|
|
__func_name__ |
|
) |
| |
Value:std::nullptr_t __func_name__(...); \
template <class T> \
struct __trait_name__ \
{ \
template <class U, U> struct helper; \
template <class U> static std::uint8_t test(helper<U*, &__func_name__>*); \
template <class U> static std::uint16_t test(...); \
static constexpr bool value = sizeof(test<T>(0)) == sizeof(std::uint8_t); \
}
Definition at line 35 of file traits.h.
#define TTK_DECLARE_HAS_MEMBER |
( |
|
__trait_name__, |
|
|
|
__member_name__ |
|
) |
| |
Value:template <class T> \
struct __trait_name__ \
{ \
typedef typename std::remove_const<T>::type check_type; \
struct base { void __member_name__() {}}; \
struct mixin : public base, public check_type {}; \
template <void (base::*)()> struct aux {}; \
template <class U> static std::false_type test(aux<&U::__member_name__>*); \
template <class U> static std::true_type test(...); \
static constexpr bool value = (sizeof(std::true_type) == sizeof(test<mixin>(0))); \
}
Definition at line 22 of file traits.h.