From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2136) id C57FA3959C69; Wed, 17 Jun 2020 19:02:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C57FA3959C69 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592420541; bh=5xJdajpG5ZM8iklzrkeu2YtyoarOQGeEVeYQXjCvIgw=; h=From:To:Subject:Date:From; b=QIMV70iHAdkBu/i76/QEszWx4DnxFLOnHHzD9zfl/b9FSUizEb3Xps0mIulZh606e MjCN4ollrpyBI0mRO3DFt5I2nKZqjNNS5BEneMszE53sy3jk9o1oaqj9e660uB10Dj 309BUHIdPzuf3dGwW84vR6s+5UDf4R+dqffUcwBc= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Aldy Hernandez To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc/devel/ranger] libstdc++: Simplify std::three_way_comparable_with (LWG 3360) X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/devel/ranger X-Git-Oldrev: 0294dc5f4eec5a07d70fac48f75c498c3b1a339b X-Git-Newrev: 256f67aa078de0e7bf53a0870c2cb87ab90cda09 Message-Id: <20200617190221.C57FA3959C69@sourceware.org> Date: Wed, 17 Jun 2020 19:02:21 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 19:02:21 -0000 https://gcc.gnu.org/g:256f67aa078de0e7bf53a0870c2cb87ab90cda09 commit 256f67aa078de0e7bf53a0870c2cb87ab90cda09 Author: Jonathan Wakely Date: Wed Feb 19 21:45:59 2020 +0000 libstdc++: Simplify std::three_way_comparable_with (LWG 3360) This also removes a useless condition that was supposed to be removed by the P1959R0 changes, but left in when that was implemented. * libsupc++/compare (three_way_comparable): Remove always-false check that should have been removed with weak_equality (P1959R0). (three_way_comparable_with): Likewise. Reorder requirements (LWG 3360). Diff: --- libstdc++-v3/ChangeLog | 4 ++++ libstdc++-v3/libsupc++/compare | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 1711a359256..622c2948eab 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,9 @@ 2020-02-19 Jonathan Wakely + * libsupc++/compare (three_way_comparable): Remove always-false check + that should have been removed with weak_equality (P1959R0). + (three_way_comparable_with): Likewise. Reorder requirements (LWG 3360). + * include/std/concepts (__detail::__partially_ordered_with): Move here from . (totally_ordered, totally_ordered_with): Use __partially_ordered_with diff --git a/libstdc++-v3/libsupc++/compare b/libstdc++-v3/libsupc++/compare index a74ebc845bf..b88b691b9e1 100644 --- a/libstdc++-v3/libsupc++/compare +++ b/libstdc++-v3/libsupc++/compare @@ -417,8 +417,7 @@ namespace std template concept three_way_comparable = __detail::__weakly_eq_cmp_with<_Tp, _Tp> - && (!convertible_to<_Cat, partial_ordering> - || __detail::__partially_ordered_with<_Tp, _Tp>) + && __detail::__partially_ordered_with<_Tp, _Tp> && requires(const remove_reference_t<_Tp>& __a, const remove_reference_t<_Tp>& __b) { { __a <=> __b } -> __detail::__compares_as<_Cat>; @@ -426,16 +425,15 @@ namespace std template concept three_way_comparable_with - = __detail::__weakly_eq_cmp_with<_Tp, _Up> - && (!convertible_to<_Cat, partial_ordering> - || __detail::__partially_ordered_with<_Tp, _Up>) - && three_way_comparable<_Tp, _Cat> + = three_way_comparable<_Tp, _Cat> && three_way_comparable<_Up, _Cat> && common_reference_with&, const remove_reference_t<_Up>&> && three_way_comparable< common_reference_t&, const remove_reference_t<_Up>&>, _Cat> + && __detail::__weakly_eq_cmp_with<_Tp, _Up> + && __detail::__partially_ordered_with<_Tp, _Up> && requires(const remove_reference_t<_Tp>& __t, const remove_reference_t<_Up>& __u) { { __t <=> __u } -> __detail::__compares_as<_Cat>;