From 4cd6eb4e2fcf43b58e02bc74c26d74feaa8cdbd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Sun, 27 Nov 2016 17:58:47 +0100 Subject: [PATCH] added missing std::forwards to decltype based stuff the previous version could have caused some minor trouble in extreme edge-cases --- thread_pool.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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();