From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 2AACC3858D28; Tue, 12 Apr 2022 18:10:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2AACC3858D28 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdbsupport: use result_of_t instead of result_of in parallel-for.h X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 8dddb06c598dd4cbdbd60653c54881912fd839b5 X-Git-Newrev: a09520cdd91a87ada081b065c42256bec2be6946 Message-Id: <20220412181025.2AACC3858D28@sourceware.org> Date: Tue, 12 Apr 2022 18:10:25 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2022 18:10:25 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da09520cdd91a= 87ada081b065c42256bec2be6946 commit a09520cdd91a87ada081b065c42256bec2be6946 Author: Simon Marchi Date: Tue Apr 12 12:30:08 2022 -0400 gdbsupport: use result_of_t instead of result_of in parallel-for.h =20 When building with -std=3Dc++11, I get: =20 In file included from /home/smarchi/src/binutils-gdb/gdb/unittests/para= llel-for-selftests.c:22: = /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/= parallel-for.h:134:10: error: =C3=A2=E2=82=AC=CB=9Cresult_of_t=C3=A2=E2=82= =AC=E2=84=A2 is not a member of =C3=A2=E2=82=AC=CB=9Cstd=C3=A2=E2=82=AC=E2= =84=A2; did you mean =C3=A2=E2=82=AC=CB=9Cresult_of=C3=A2=E2=82=AC=E2=84=A2? 134 | std::result_of_t | ^~~~~~~~~~~ | result_of =20 This is because result_of_t has been introduced in C++14. Use the equivalent result_of<...>::type instead. =20 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. =20 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: =20 template typename gdb::detail::par_for_accumulator< - std::result_of_t + typename std::result_of::type >::result_type parallel_for_each (unsigned n, RandomIt first, RandomIt last, RangeFunction callback) { - typedef typename std::result_of_t - result_type; + using result_type + =3D typename std::result_of::type; =20 size_t n_threads =3D thread_pool::g_thread_pool->thread_count (); size_t n_elements =3D last - first;