This question already has an answer here:
I want to get std::true_type if the following expression compiles:
template<typename T>
static constexpr std::true_type check(T*) ??????
std::declval<T>().func_name( std::declval<Args>()... ) // method to check for
and std::false_type otherwise which I normally do with
template<typename>
static constexpr std::false_type check(...);
I search something like enable_if which returns me a constant type if the expression compiles. Seems so easy but breaks my head :-)
I personally use that (which use full signature):
So in your case, use something like:
And test it like: