From b47f8afa138aca397bf4c073d7538420e1d97c1f Mon Sep 17 00:00:00 2001 From: yyPLUSPLUS Date: Tue, 16 Sep 2025 13:19:58 +0800 Subject: [PATCH] Remove trailing return type from enqueue; rely on C++14+ deduction --- ThreadPool.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ThreadPool.h b/ThreadPool.h index 4183203..81d4b9c 100644 --- a/ThreadPool.h +++ b/ThreadPool.h @@ -15,8 +15,7 @@ class ThreadPool { public: ThreadPool(size_t); template - auto enqueue(F&& f, Args&&... args) - -> std::future::type>; + auto enqueue(F&& f, Args&&... args) ; ~ThreadPool(); private: // need to keep track of threads so we can join them @@ -61,7 +60,6 @@ inline ThreadPool::ThreadPool(size_t threads) // add new work item to the pool template auto ThreadPool::enqueue(F&& f, Args&&... args) - -> std::future::type> { using return_type = typename std::result_of::type;