generic member function pointer as a template parameter
You could try something like this: template <typename T, typename R, typename …Args> R proxycall(T & obj, R (T::*mf)(Args…), Args &&… args) { return (obj.*mf)(std::forward<Args>(args)…); } Usage: proxycall(obj, &hello::f); Alternatively, to make the PTMF into a template argument, try specialization: template <typename T, T> struct proxy; template <typename T, typename R, typename …Args, R (T::*mf)(Args…)> … Read more