This is a continuation of this problem: A generic functor for functions with any argument list
I have this functor class (for the full code, see the 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 easily access args ... with a recursive peeling function, as described here http://www2.research.att.com/~bs/C++0xFAQ.html#variadic-templates
My problem: I want to access the argument types f, i.e. ARGS ..., in the constructor. Obviously, I canโt access the values โโbecause they are not there yet, but the list of argument types is somehow shaded in f, right?
c ++ c ++ 11 functor function-pointers variadic-templates
steffen
source share