Skip to content

Commit 634a7ad

Browse files
committed
Fix build errors
1 parent 239e3dc commit 634a7ad

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

include/bulbit/async_job.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ class AsyncJob : public ParallelJob
8282
};
8383

8484
template <typename F, typename... Args>
85-
inline auto RunAsync(ThreadPool* thread_pool, F func, Args&&... args)
85+
inline auto RunAsync(ThreadPool* thread_pool, F&& func, Args&&... args)
8686
{
87-
auto fvoid = std::bind(func, std::forward<Args>(args)...);
88-
using R = std::invoke_result_t<F, Args...>;
87+
auto fvoid = std::bind_front(func, std::forward<Args>(args)...);
88+
using R = std::invoke_result_t<decltype(fvoid)>;
8989
auto job = std::make_unique<AsyncJob<R>>(std::move(fvoid));
9090

9191
std::unique_lock<std::mutex> lock;
@@ -102,7 +102,7 @@ inline auto RunAsync(ThreadPool* thread_pool, F func, Args&&... args)
102102
}
103103

104104
template <typename F, typename... Args>
105-
inline auto RunAsync(F func, Args&&... args)
105+
inline auto RunAsync(F&& func, Args&&... args)
106106
{
107107
return RunAsync(ThreadPool::global_thread_pool.get(), func, std::forward<Args>(args)...);
108108
}

0 commit comments

Comments
 (0)