Assuming I have a member function pointer how I could write code that automatically deduce parameters for given template signature:
template<typename T> class Foo {};
template<typename R, typename C, typename... A>
class Foo<R(C, A...)> { };
For C and R there is no problem as something similar to this does the trick:
template<typename R, typename C, typename... A>
R deduce_R_type(R(C::*)(A...));
template<typename R, typename C, typename... A>
C deduce_C_type(R(C::*)(A...));
Then I can actually plug it in to the Foo instantiation but how to deduce the types coming from the variadic part of the template?
Foo<
decltype(deduce_R_type(&SomeClass::SomeFunction)) (
decltype(deduce_C_type(&SomeClass::SomeFunction)), ___ ??? ___)> instance