From d156606235629f0d448fb93ef073f3065eb5596a Mon Sep 17 00:00:00 2001 From: Q-Wednesday <1403292286@qq.com> Date: Mon, 30 Oct 2023 17:40:40 +0800 Subject: [PATCH] fix(exercise): replace std::result_of with std::invoke_result since the old one is deprecated in C++20; --- exercises/7/7.1/thread_pool.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/7/7.1/thread_pool.hpp b/exercises/7/7.1/thread_pool.hpp index c1e22cbb..72e2f60c 100644 --- a/exercises/7/7.1/thread_pool.hpp +++ b/exercises/7/7.1/thread_pool.hpp @@ -11,6 +11,7 @@ #ifndef THREAD_POOL_H #define THREAD_POOL_H +#include #include // std::vector #include // std::queue #include // std::make_shared @@ -96,7 +97,7 @@ inline ThreadPool::ThreadPool(size_t threads): stop(false) { template decltype(auto) ThreadPool::enqueue(F&& f, Args&&... args) { // deduce return type - using return_type = typename std::result_of::type; + using return_type = typename std::invoke_result::type; // fetch task auto task = std::make_shared>(