From 6e26ad2bf0b0b006bc9ad69da015a0d3bcf75111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Thu, 1 Dec 2016 20:06:33 +0100 Subject: [PATCH] made change of commit b997641ba4 template-based: no runtime cost --- thread_pool.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/thread_pool.hpp b/thread_pool.hpp index 8652de1..495ef51 100644 --- a/thread_pool.hpp +++ b/thread_pool.hpp @@ -52,8 +52,8 @@ class thread_pool /* the main loop of the threads */ void loop(); - template - auto _add_task_internal(bool front, F&& f, Args&&... args) + template + auto _add_task_internal(F&& f, Args&&... args) -> std::future(args)...))>; public: @@ -91,8 +91,8 @@ public: inline size_t get_queue_size() const { return queue.size(); } }; -template -auto thread_pool::_add_task_internal(bool front, F&& f, Args&&... args) +template +auto thread_pool::_add_task_internal(F&& f, Args&&... args) -> std::future(args)...))> { auto pckgd_tsk = std::make_shared(args)...))()> > @@ -130,14 +130,14 @@ template auto thread_pool::add_task(F&& f, Args&&... args) -> std::future(args)...))> { - return _add_task_internal(false, std::forward(f), std::forward(args)...); + return _add_task_internal(std::forward(f), std::forward(args)...); } template auto thread_pool::priority_task(F&& f, Args&&... args) -> std::future(args)...))> { - return _add_task_internal(true, std::forward(f), std::forward(args)...); + return _add_task_internal(std::forward(f), std::forward(args)...); } template