
Hi Is it possible to pass variadic template arguments to bind, such that bind uses them as the placeholder arguments (_1, _2, _3 etc) I show my use case below. struct job_queue { // copy f into list for asynchronous envocation by another thread void enqueue(boost::function<void()> f); }; //----------------------------------------------------------------------- // helper class to define correct form of the member function callback template<class T, typename... Args> struct cb { typedef void (T::*type)(Args...); }; // a job defines a callback function which is any member function taking any number of arguments of any type template<class T, typename... Args> class job_t { boost::shared_ptr<job_queue> queue; boost::function<void(Args...)> arg_func; public: job_t(typename cb<T, Args...>::type cb, boost::shared_ptr<T> that, boost::shared_ptr<job_queue> q) : arg_func(boost::bind(cb, that, Args...)), queue(q) {} // normally would be _1, _2, _3, etc void post(Args&... args) { boost::function<void()> f = boost::bind(arg_func, args...); queue->enqueue(f); } };