Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix problem when compiling with c++20 #227

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading