From 98b27a2ae829a88bfbef0ae3dd33d2933289b622 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 19 Feb 2020 05:41:37 +0100 Subject: [PATCH] IntrusivePtr: remove ordering operators These violate the C++ standard because comparing pointers to unrelated objects is undefined behavior. --- src/IntrusivePtr.h | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/IntrusivePtr.h b/src/IntrusivePtr.h index 7915599e7a..44652b7d09 100644 --- a/src/IntrusivePtr.h +++ b/src/IntrusivePtr.h @@ -243,24 +243,6 @@ bool operator!=(const T* x, const IntrusivePtr& y) { return x != y.get(); } -/** - * @relates IntrusivePtr - */ -template -bool operator<(const IntrusivePtr& x, const T* y) - { - return x.get() < y; - } - -/** - * @relates IntrusivePtr - */ -template -bool operator<(const T* x, const IntrusivePtr& y) - { - return x < y.get(); - } - // -- comparison to intrusive pointer ------------------------------------------ // Using trailing return type and decltype() here removes this function from @@ -286,13 +268,3 @@ auto operator!=(const IntrusivePtr& x, const IntrusivePtr& y) return x.get() != y.get(); } -/** - * @relates IntrusivePtr - */ -template -auto operator<(const IntrusivePtr& x, const IntrusivePtr& y) --> decltype(x.get() < y.get()) - { - return x.get() < y.get(); - } -