diff options
author | Lancelot Six <lancelot.six@amd.com> | 2023-10-13 12:39:55 +0000 |
---|---|---|
committer | Lancelot Six <lancelot.six@amd.com> | 2023-11-21 11:52:36 +0000 |
commit | 70d02be7e369e8763bf3238eb7c6ae7f9efb5429 (patch) | |
tree | 459590d351ef1d66cd99734dca5f80448eea3b47 /gdbsupport/parallel-for.h | |
parent | 393be56421a81e44c8728c8b31df66b319697398 (diff) | |
download | binutils-70d02be7e369e8763bf3238eb7c6ae7f9efb5429.zip binutils-70d02be7e369e8763bf3238eb7c6ae7f9efb5429.tar.gz binutils-70d02be7e369e8763bf3238eb7c6ae7f9efb5429.tar.bz2 |
gdbsupport: Replace gdb::invoke_result with std::invoke_result
Given that GDB now requires C++17, we can replace gdb::invoke_result
with std::invoke_result which is provided by <type_traits>.
This patch also removes gdbsupport/invoke-result.h as it is not used
anymore.
Change-Id: I7e567356d38d6b3d85d8797d61cfc83f6f933f22
Approved-By: Tom Tromey <tom@tromey.com>
Approved-By: Pedro Alves <pedro@palves.net>
Diffstat (limited to 'gdbsupport/parallel-for.h')
-rw-r--r-- | gdbsupport/parallel-for.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gdbsupport/parallel-for.h b/gdbsupport/parallel-for.h index b57f7ea..ee7bfd9 100644 --- a/gdbsupport/parallel-for.h +++ b/gdbsupport/parallel-for.h @@ -22,7 +22,6 @@ #include <algorithm> #include <type_traits> -#include "gdbsupport/invoke-result.h" #include "gdbsupport/thread-pool.h" #include "gdbsupport/function-view.h" @@ -145,14 +144,14 @@ private: template<class RandomIt, class RangeFunction> typename gdb::detail::par_for_accumulator< - typename gdb::invoke_result<RangeFunction, RandomIt, RandomIt>::type + typename std::invoke_result<RangeFunction, RandomIt, RandomIt>::type >::result_type parallel_for_each (unsigned n, RandomIt first, RandomIt last, RangeFunction callback, gdb::function_view<size_t(RandomIt)> task_size = nullptr) { using result_type - = typename gdb::invoke_result<RangeFunction, RandomIt, RandomIt>::type; + = typename std::invoke_result<RangeFunction, RandomIt, RandomIt>::type; /* If enabled, print debug info about how the work is distributed across the threads. */ @@ -305,13 +304,13 @@ parallel_for_each (unsigned n, RandomIt first, RandomIt last, template<class RandomIt, class RangeFunction> typename gdb::detail::par_for_accumulator< - typename gdb::invoke_result<RangeFunction, RandomIt, RandomIt>::type + typename std::invoke_result<RangeFunction, RandomIt, RandomIt>::type >::result_type sequential_for_each (unsigned n, RandomIt first, RandomIt last, RangeFunction callback, gdb::function_view<size_t(RandomIt)> task_size = nullptr) { - using result_type = typename gdb::invoke_result<RangeFunction, RandomIt, RandomIt>::type; + using result_type = typename std::invoke_result<RangeFunction, RandomIt, RandomIt>::type; gdb::detail::par_for_accumulator<result_type> results (0); |