From 488db8f52c2715f5745cc41132af187ab4eea8b9 Mon Sep 17 00:00:00 2001 From: andrevis Date: Fri, 18 Sep 2020 12:18:08 +0300 Subject: [PATCH] Update ThreadPool.h result_of and its helper type result_of_t are deprecated as of C++17 --- ThreadPool.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ThreadPool.h b/ThreadPool.h index 4183203..ee885f4 100644 --- a/ThreadPool.h +++ b/ThreadPool.h @@ -16,7 +16,7 @@ class ThreadPool { ThreadPool(size_t); template auto enqueue(F&& f, Args&&... args) - -> std::future::type>; + -> std::future; ~ThreadPool(); private: // need to keep track of threads so we can join them @@ -61,9 +61,9 @@ inline ThreadPool::ThreadPool(size_t threads) // add new work item to the pool template auto ThreadPool::enqueue(F&& f, Args&&... args) - -> std::future::type> + -> std::future { - using return_type = typename std::result_of::type; + using return_type = decltype(f(args...)); auto task = std::make_shared< std::packaged_task >( std::bind(std::forward(f), std::forward(args)...)