public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Simon Marchi <simark@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdbsupport: use result_of_t instead of result_of in parallel-for.h Date: Tue, 12 Apr 2022 18:10:25 +0000 (GMT) [thread overview] Message-ID: <20220412181025.2AACC3858D28@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a09520cdd91a87ada081b065c42256bec2be6946 commit a09520cdd91a87ada081b065c42256bec2be6946 Author: Simon Marchi <simon.marchi@efficios.com> Date: Tue Apr 12 12:30:08 2022 -0400 gdbsupport: use result_of_t instead of result_of in parallel-for.h When building with -std=c++11, I get: In file included from /home/smarchi/src/binutils-gdb/gdb/unittests/parallel-for-selftests.c:22: /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/parallel-for.h:134:10: error: ‘result_of_t’ is not a member of ‘std’; did you mean ‘result_of’? 134 | std::result_of_t<RangeFunction (RandomIt, RandomIt)> | ^~~~~~~~~~~ | result_of This is because result_of_t has been introduced in C++14. Use the equivalent result_of<...>::type instead. result_of and result_of_t have been removed in C++20 though, so I think we'll need some patches eventually to make the code use invoke_result instead, depending on the C++ version. Change-Id: I4817f361c0ebcdd4b32976898fc368bb302b61b9 Diff: --- gdbsupport/parallel-for.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gdbsupport/parallel-for.h b/gdbsupport/parallel-for.h index 44303abb716..713ec660306 100644 --- a/gdbsupport/parallel-for.h +++ b/gdbsupport/parallel-for.h @@ -131,13 +131,13 @@ private: template<class RandomIt, class RangeFunction> typename gdb::detail::par_for_accumulator< - std::result_of_t<RangeFunction (RandomIt, RandomIt)> + typename std::result_of<RangeFunction (RandomIt, RandomIt)>::type >::result_type parallel_for_each (unsigned n, RandomIt first, RandomIt last, RangeFunction callback) { - typedef typename std::result_of_t<RangeFunction (RandomIt, RandomIt)> - result_type; + using result_type + = typename std::result_of<RangeFunction (RandomIt, RandomIt)>::type; size_t n_threads = thread_pool::g_thread_pool->thread_count (); size_t n_elements = last - first;
reply other threads:[~2022-04-12 18:10 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220412181025.2AACC3858D28@sourceware.org \ --to=simark@sourceware.org \ --cc=gdb-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).