How do I get the argument types of a function pointer in a variadic template class?
问题 This is a follow up of this problem: Generic functor for functions with any argument list I have this functor class (full code see link above): template<typename... ARGS> class Foo { std::function<void(ARGS...)> m_f; public: Foo( std::function<void(ARGS...)> f ) : m_f(f) {} void operator()(ARGS... args) const { m_f(args...); } }; In operator() I can access the args... easily with a recursive "peeling" function as described here http://www2.research.att.com/~bs/C++0xFAQ.html#variadic-templates