#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_static_foo, T::foo, void (*)(void)); // signature is the important part for static. it is not (T::*)

class StaticFoo
{
public:
    static void foo();
};

class Foo
{
public:
    void foo();
};

class Bar
{
};

static_assert(has_static_foo<StaticFoo>::value, "");
static_assert(!has_static_foo<Foo>::value, "");
static_assert(!has_static_foo<Bar>::value, "");

int main()
{}
