public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Tamar Christina <tnfchris@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/arm-struct-reorg-wip)] libstdc++: Update __cpp_lib_three_way_comparison macro Date: Fri, 17 Jul 2020 14:33:35 +0000 (GMT) [thread overview] Message-ID: <20200717143335.C80C93A0F002@sourceware.org> (raw) https://gcc.gnu.org/g:73a0a21d22da7db9687853a4ee7d55fc9aa818a4 commit 73a0a21d22da7db9687853a4ee7d55fc9aa818a4 Author: Jonathan Wakely <jwakely@redhat.com> Date: Mon Apr 20 17:50:10 2020 +0100 libstdc++: Update __cpp_lib_three_way_comparison macro With P1614R2 fully implemented (except for the <chrono> types which we don't support at all) we can define the feature test macro to the new value. * include/std/version (__cpp_lib_three_way_comparison): Update value. * libsupc++/compare (__cpp_lib_three_way_comparison): Likewise. Diff: --- libstdc++-v3/ChangeLog | 3 +++ libstdc++-v3/include/std/version | 2 +- libstdc++-v3/libsupc++/compare | 16 ++++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3d0ddf5f36e..7e6a010a4ab 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2020-04-20 Jonathan Wakely <jwakely@redhat.com> + * include/std/version (__cpp_lib_three_way_comparison): Update value. + * libsupc++/compare (__cpp_lib_three_way_comparison): Likewise. + * include/bits/stl_map.h (map): Define operator<=> and remove operator< for C++20. * include/bits/stl_multimap.h (multimap): Likewise. diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index d9a47ee8e8a..6d7dcc46023 100644 --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -200,7 +200,7 @@ #endif #define __cpp_lib_span 202002L #if __cpp_impl_three_way_comparison >= 201907L && __cpp_lib_concepts -# define __cpp_lib_three_way_comparison 201711L +# define __cpp_lib_three_way_comparison 201907L #endif #define __cpp_lib_to_array 201907L #endif diff --git a/libstdc++-v3/libsupc++/compare b/libstdc++-v3/libsupc++/compare index e5fb322ed9e..28dfe843ee7 100644 --- a/libstdc++-v3/libsupc++/compare +++ b/libstdc++-v3/libsupc++/compare @@ -39,7 +39,7 @@ #include <concepts> #if __cpp_lib_concepts -# define __cpp_lib_three_way_comparison 201711L +# define __cpp_lib_three_way_comparison 201907L #endif namespace std @@ -866,12 +866,23 @@ namespace std namespace __detail { - // [expos.only.func] + // [expos.only.func] synth-three-way inline constexpr struct _Synth3way { + template<typename _Tp, typename _Up> + static constexpr bool + _S_noexcept(const _Tp* __t = nullptr, const _Up* __u = nullptr) + { + if constexpr (three_way_comparable_with<_Tp, _Up>) + return noexcept(*__t <=> *__u); + else + return noexcept(*__t < *__u) && noexcept(*__u < *__t); + } + template<typename _Tp, typename _Up> constexpr auto operator()(const _Tp& __t, const _Up& __u) const + noexcept(_S_noexcept<_Tp, _Up>()) requires requires { { __t < __u } -> __boolean_testable; @@ -892,6 +903,7 @@ namespace std } } __synth3way = {}; + // [expos.only.func] synth-three-way-result template<typename _Tp, typename _Up = _Tp> using __synth3way_t = decltype(__detail::__synth3way(std::declval<_Tp&>(),
reply other threads:[~2020-07-17 14:33 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=20200717143335.C80C93A0F002@sourceware.org \ --to=tnfchris@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.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).