diff --git a/thread_pool.hpp b/thread_pool.hpp index d848419..1880a08 100644 --- a/thread_pool.hpp +++ b/thread_pool.hpp @@ -70,10 +70,10 @@ public: /* adding tasks to the queue */ // TODO: use template-based policies to deal with priority tasks to avoid code-dupe. template - auto add_task(F&& f, Args&&... args) -> std::future; + auto add_task(F&& f, Args&&... args) -> std::future(args)...))>; template - auto priority_task(F&& f, Args&&... args) -> std::future; + auto priority_task(F&& f, Args&&... args) -> std::future(args)...))>; template void add_task(std::packaged_task& ); template void priority_task(std::packaged_task& ); @@ -107,9 +107,9 @@ thread_pool::~thread_pool() template auto thread_pool::add_task(F&& f, Args&&... args) --> std::future +-> std::future(args)...))> { - auto pckgd_tsk = std::make_shared > + auto pckgd_tsk = std::make_shared(args)...))()> > (std::bind(std::forward(f), std::forward(args)...)); { @@ -123,9 +123,9 @@ auto thread_pool::add_task(F&& f, Args&&... args) template auto thread_pool::priority_task(F&& f, Args&&... args) --> std::future +-> std::future(args)...))> { - auto pckgd_tsk = std::make_shared > + auto pckgd_tsk = std::make_shared(args)...))()> > (std::bind(std::forward(f), std::forward(args)...)); auto ret_val= pckgd_tsk->get_future();