From patchwork Sat Nov 27 18:32:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 73286 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 15831B70B0 for ; Sun, 28 Nov 2010 05:32:19 +1100 (EST) Received: (qmail 21615 invoked by alias); 27 Nov 2010 18:32:16 -0000 Received: (qmail 21600 invoked by uid 22791); 27 Nov 2010 18:32:15 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 27 Nov 2010 18:32:11 +0000 Received: by wyb40 with SMTP id 40so3188815wyb.20 for ; Sat, 27 Nov 2010 10:32:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.141.14 with SMTP id f14mr1450809wej.22.1290882728320; Sat, 27 Nov 2010 10:32:08 -0800 (PST) Received: by 10.216.139.42 with HTTP; Sat, 27 Nov 2010 10:32:08 -0800 (PST) In-Reply-To: <4CE324EF.2080600@oracle.com> References: <4CE324EF.2080600@oracle.com> Date: Sat, 27 Nov 2010 18:32:08 +0000 Message-ID: Subject: Re: shared_ptr comparisons From: Jonathan Wakely To: Paolo Carlini Cc: "libstdc++" , gcc-patches Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 17 November 2010 00:42, Paolo Carlini wrote: > On 11/17/2010 12:46 AM, Jonathan Wakely wrote: >> Unless I'm mistaken we should only have operators <, == and != for shared_ptr. >> >> Any objections to this change? >> > Not from me. To be honest I have no idea where those operators comes > from, and certainly we don't have anything similar for the actual > std::shared_ptr... 2010-11-27 Jonathan Wakely * include/bits/shared_ptr_base.h (operator>, operator>=, operator<=): Remove comparisons not specified in the C++0x draft. tested x86_64-linux and committed to trunk Index: include/bits/shared_ptr_base.h =================================================================== --- include/bits/shared_ptr_base.h (revision 167056) +++ include/bits/shared_ptr_base.h (working copy) @@ -1098,25 +1098,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std) : public _Sp_less<__shared_ptr<_Tp, _Lp>> { }; - // XXX LessThanComparable<_Tp> concept should provide >, >= and <= - template - inline bool - operator>(const __shared_ptr<_Tp, _Lp>& __a, - const __shared_ptr<_Tp, _Lp>& __b) - { return __a.get() > __b.get(); } - - template - inline bool - operator>=(const __shared_ptr<_Tp, _Lp>& __a, - const __shared_ptr<_Tp, _Lp>& __b) - { return __a.get() >= __b.get(); } - - template - inline bool - operator<=(const __shared_ptr<_Tp, _Lp>& __a, - const __shared_ptr<_Tp, _Lp>& __b) - { return __a.get() <= __b.get(); } - // 2.2.3.8 shared_ptr specialized algorithms. template inline void