From patchwork Tue Nov 16 23:46:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: shared_ptr comparisons Date: Tue, 16 Nov 2010 13:46:20 -0000 From: Jonathan Wakely X-Patchwork-Id: 71479 Message-Id: To: "libstdc++" , gcc-patches Unless I'm mistaken we should only have operators <, == and != for shared_ptr. Any objections to this change? Tested x86_64-linux Index: include/bits/shared_ptr_base.h =================================================================== --- include/bits/shared_ptr_base.h (revision 166459) +++ 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