Skip to content

Commit 264cc0c

Browse files
committed
WorkerThreadsPool: Modernize std::result_of usage to C++17
1 parent 47348f0 commit 264cc0c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libs/core/include/mrpt/core/WorkerThreadsPool.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class WorkerThreadsPool
8282
* available. */
8383
template <class F, class... Args>
8484
[[nodiscard]] auto enqueue(F&& f, Args&&... args)
85-
-> std::future<typename std::result_of<F(Args...)>::type>;
85+
-> std::future<std::invoke_result_t<F(Args...)>>;
8686

8787
/** Returns the number of enqueued tasks, currently waiting for a free
8888
* working thread to process them. */
@@ -110,9 +110,9 @@ class WorkerThreadsPool
110110

111111
template <class F, class... Args>
112112
auto WorkerThreadsPool::enqueue(F&& f, Args&&... args)
113-
-> std::future<typename std::result_of<F(Args...)>::type>
113+
-> std::future<std::invoke_result_t<F(Args...)>>
114114
{
115-
using return_type = typename std::result_of<F(Args...)>::type;
115+
using return_type = std::invoke_result_t<F(Args...)>;
116116

117117
auto task = std::make_shared<std::packaged_task<return_type()>>(
118118
std::bind(std::forward<F>(f), std::forward<Args>(args)...));

0 commit comments

Comments
 (0)