Skip to content

Commit

Permalink
fix problem when compiling with c++20 (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
senbaikang authored Jun 4, 2024
1 parent bad78d1 commit 632fd55
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/z5/util/threadpool.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class ThreadPool
* If the task throws an exception, it will be raised on the call to get().
*/
template<class F>
std::future<typename std::result_of<F(int)>::type> enqueueReturning(F&& f) ;
std::future<typename std::invoke_result_t<F, int>> enqueueReturning(F&& f) ;

/**
* Enqueue function for tasks without return value.
Expand Down Expand Up @@ -263,10 +263,10 @@ inline ThreadPool::~ThreadPool()
}

template<class F>
inline std::future<typename std::result_of<F(int)>::type>
inline std::future<typename std::invoke_result_t<F, int>>
ThreadPool::enqueueReturning(F&& f)
{
typedef typename std::result_of<F(int)>::type result_type;
typedef typename std::invoke_result_t<F, int> result_type;
typedef std::packaged_task<result_type(int)> PackageType;

auto task = std::make_shared<PackageType>(f);
Expand Down

0 comments on commit 632fd55

Please sign in to comment.