I personally use that (which use full signature):
#include <cstdint>
#define DEFINE_HAS_SIGNATURE(traitsName, funcName, signature) \
template <typename U, typename... Args> \
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); \
}
So in your case, use something like:
DEFINE_HAS_SIGNATURE(has_func_name, T::func_name, void (T::*)(Args...));
And test it like:
struct C
{
void func_name(char, int);
};
static_assert(has_func_name<C, char, int>::value, "unexpected non declared void C::func_name(char, int)");
static_assert(!has_func_name<C, int, int>::value, "unexpected declared void C::func_name(int, int)");