We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 467d2f4 commit ce41656Copy full SHA for ce41656
1 file changed
ThreadPool.hpp
@@ -9,8 +9,7 @@ class ThreadPool {
9
public:
10
explicit ThreadPool(size_t);
11
template<class F, class... Args>
12
- auto enqueue(F&& f, Args&&... args)
13
- -> std::future<std::invoke_result_t<F, Args...>>;
+ decltype(auto) enqueue(F&& f, Args&&... args);
14
~ThreadPool();
15
private:
16
// need to keep track of threads so we can join them
@@ -54,8 +53,7 @@ inline ThreadPool::ThreadPool(size_t threads)
54
53
55
// add new work item to the pool
56
57
-auto ThreadPool::enqueue(F&& f, Args&&... args)
58
- -> std::future<std::invoke_result_t<F, Args...>>
+decltype(auto) ThreadPool::enqueue(F&& f, Args&&... args)
59
{
60
using return_type = std::invoke_result_t<F, Args...>;
61
0 commit comments