diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2022-08-09 10:52:39 +0100 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2022-08-09 10:52:39 +0100 |
| commit | adb0cd62a98cca26c740364bca308d089bb07cc1 (patch) | |
| tree | ee161017861ab049c0bc7e890cd5885bd8815ec5 | |
| parent | d9e5462da61c3e2137a21a868a36f7022a39b59e (diff) | |
| download | llvm-adb0cd62a98cca26c740364bca308d089bb07cc1.zip llvm-adb0cd62a98cca26c740364bca308d089bb07cc1.tar.gz llvm-adb0cd62a98cca26c740364bca308d089bb07cc1.tar.bz2 | |
[Support] TaskQueue.h - replace std::result_of_t with std::invoke_result_t
std::result_of_t is deprecated in C++17
Fixes #57023
| -rw-r--r-- | llvm/include/llvm/Support/TaskQueue.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/include/llvm/Support/TaskQueue.h b/llvm/include/llvm/Support/TaskQueue.h index d89ce2b..1b44a16 100644 --- a/llvm/include/llvm/Support/TaskQueue.h +++ b/llvm/include/llvm/Support/TaskQueue.h @@ -38,7 +38,7 @@ class TaskQueue { // type-specialized domain (before type erasure) and then erase this into a // std::function. template <typename Callable> struct Task { - using ResultTy = std::result_of_t<Callable()>; + using ResultTy = std::invoke_result_t<Callable>; explicit Task(Callable C, TaskQueue &Parent) : C(std::move(C)), P(std::make_shared<std::promise<ResultTy>>()), Parent(&Parent) {} @@ -78,13 +78,13 @@ public: /// used to wait for the task (and all previous tasks that have not yet /// completed) to finish. template <typename Callable> - std::future<std::result_of_t<Callable()>> async(Callable &&C) { + std::future<std::invoke_result_t<Callable>> async(Callable &&C) { #if !LLVM_ENABLE_THREADS static_assert(false, "TaskQueue requires building with LLVM_ENABLE_THREADS!"); #endif Task<Callable> T{std::move(C), *this}; - using ResultTy = std::result_of_t<Callable()>; + using ResultTy = std::invoke_result_t<Callable>; std::future<ResultTy> F = T.P->get_future(); { std::lock_guard<std::mutex> Lock(QueueLock); |
