#include <cstddef>
#include <string>
#include <type_traits>

template <class C>
class HasGreetMethod
{
    template <class T>
    static std::true_type testSignature(void (T::*)(const char*) const);

    template <class T>
    static decltype(testSignature(&T::greet)) test(std::nullptr_t);

    template <class T>
    static std::false_type test(...);

public:
    using type = decltype(test<C>(nullptr));
    static const bool value = type::value;
};

struct A
{
    void greet(const char* name) const;
};

struct Derived : A { };

struct B
{
    void greet(std::string name) const;
};

static_assert(HasGreetMethod<A>::value, "");
static_assert(HasGreetMethod<Derived>::value, "");
static_assert(!HasGreetMethod<B>::value, "");

int main()
{
    return 0;
}
