diff --git a/include/rexy/threadpool.hpp b/include/rexy/threadpool.hpp index 70ba8f8..130a02f 100644 --- a/include/rexy/threadpool.hpp +++ b/include/rexy/threadpool.hpp @@ -1,6 +1,6 @@ /** This file is a part of rexy's general purpose library - Copyright (C) 2020 rexy712 + Copyright (C) 2020-2022 rexy712 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,6 +29,7 @@ #include //future, packaged_task #include //function, bind #include //move, forward +#include //invoke_result_t #include "rexy.hpp" @@ -62,14 +63,14 @@ namespace rexy{ void invalidate(void); template - auto add_job(Func&& f, Args&&... args) -> std::future(f)(std::forward(args)...))>; + auto add_job(Func&& f, Args&&... args) -> std::future>; private: void worker_loop(void); }; template - auto threadpool::add_job(Func&& f, Args&&... args) -> std::future(f)(std::forward(args)...))>{ + auto threadpool::add_job(Func&& f, Args&&... args) -> std::future>{ using return_t = decltype(std::forward(f)(std::forward(args)...)); using task_t = std::packaged_task;