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);
}
};