diff --git a/include/matador/utils/thread_pool.hpp b/include/matador/utils/thread_pool.hpp index 7754ff6..894283b 100644 --- a/include/matador/utils/thread_pool.hpp +++ b/include/matador/utils/thread_pool.hpp @@ -59,8 +59,8 @@ public: * @param args Passed arguments */ template - auto schedule(F&& func, Args&&... args) -> result_fut> { - using return_type = std::result_of_t; + auto schedule(F&& func, Args&&... args) -> result_fut> { + using return_type = std::invoke_result_t; const auto token = std::make_shared(); auto task_ptr = std::make_shared>( @@ -73,7 +73,7 @@ public: if (!running_) { return failure(std::string("Thread pool is shut down, cannot schedule new tasks.")); } - tasks_.emplace_back([task_ptr, token] { + tasks_.emplace_back([task_ptr] { try { (*task_ptr)(); } catch (...) { /* Prevent exception escape */ } }, token);