File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
third_party/com_github_progschj_threadpool/ThreadPool Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,7 @@ class ThreadPool {
1616 public:
1717 ThreadPool (size_t );
1818 template <class F , class ... Args>
19- auto enqueue (F&& f, Args&&... args)
20- -> std::future<typename std::result_of<F(Args...)>::type>;
19+ auto enqueue (F&& f, Args&&... args);
2120 ~ThreadPool ();
2221
2322 // Returns the thread ID.
@@ -69,9 +68,8 @@ inline ThreadPool::ThreadPool(size_t threads) : stop(false) {
6968
7069// add new work item to the pool
7170template <class F , class ... Args>
72- auto ThreadPool::enqueue (F&& f, Args&&... args)
73- -> std::future<typename std::result_of<F(Args...)>::type> {
74- using return_type = typename std::result_of<F (Args...)>::type;
71+ auto ThreadPool::enqueue (F&& f, Args&&... args) {
72+ using return_type = typename std::invoke_result<F, Args...>::type;
7573
7674 auto task = std::make_shared<std::packaged_task<return_type ()> >(
7775 std::bind (std::forward<F>(f), std::forward<Args>(args)...));
You can’t perform that action at this time.
0 commit comments