#include <cstdint>

#define DEFINE_HAS_SIGNATURE(traitsName, funcName, signature)               \
    template <typename U>                                                   \
    class traitsName                                                        \
    {                                                                       \
    private:                                                                \
        template<typename T, T> struct helper;                              \
        template<typename T>                                                \
        static std::uint8_t check(helper<signature, &funcName>*);           \
        template<typename T> static std::uint16_t check(...);               \
    public:                                                                 \
        static                                                              \
        constexpr bool value = sizeof(check<U>(0)) == sizeof(std::uint8_t); \
    }

DEFINE_HAS_SIGNATURE(has_foo, T::foo, void (*)(void));

struct StaticFoo { static void foo(); };
struct NormalFoo { void foo(); };
struct NoFoo {};

static_assert(has_foo<StaticFoo>::value, "Unexpected value");
static_assert(!has_foo<NormalFoo>::value, "Unexpected value");
static_assert(!has_foo<NoFoo>::value, "Unexpected value");

int main()
{
    return 0;
}
