From 5cb6e3999bb8781c22ae9196032960bdab236fc1 Mon Sep 17 00:00:00 2001 From: Thomas Helfer Date: Thu, 5 Sep 2024 11:16:30 +0200 Subject: [PATCH] replace std::result_of with std::invoke_result --- include/MGIS/ThreadPool.hxx | 2 +- include/MGIS/ThreadPool.ixx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/MGIS/ThreadPool.hxx b/include/MGIS/ThreadPool.hxx index a3938218c..c42a6b2e4 100644 --- a/include/MGIS/ThreadPool.hxx +++ b/include/MGIS/ThreadPool.hxx @@ -48,7 +48,7 @@ namespace mgis { * \param[in] a: arguments passed to the the task */ template - std::future::type>> + std::future::type>> addTask(F&&, Args&&...); //! \return the number of threads managed by the ppol size_type getNumberOfThreads() const; diff --git a/include/MGIS/ThreadPool.ixx b/include/MGIS/ThreadPool.ixx index 22b0af880..1701b7786 100644 --- a/include/MGIS/ThreadPool.ixx +++ b/include/MGIS/ThreadPool.ixx @@ -24,9 +24,9 @@ namespace mgis { struct ThreadPool::Wrapper { Wrapper(F&& f_) : f(f_) {} template - ThreadedTaskResult::type> operator()( + ThreadedTaskResult::type> operator()( Args&&... args) { - using result = typename std::result_of::type; + using result = typename std::invoke_result::type; using apply = typename std::conditional::value, GetVoid, Get>::type; ThreadedTaskResult r; @@ -61,10 +61,10 @@ namespace mgis { // add new work item to the pool template - std::future::type>> + std::future::type>> ThreadPool::addTask(F&& f, Args&&... a) { using return_type = - ThreadedTaskResult::type>; + ThreadedTaskResult::type>; using task = std::packaged_task; auto t = std::make_shared( std::bind(Wrapper(std::forward(f)), std::forward(a)...));