From c21ed8ca1f03c82731abf01fc66e4c2f2e4c2a50 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 10 Feb 2013 14:51:43 +0100 Subject: Remove dead code from QPointer. The compilers checked here are not supported in Qt 5. Additionally, the QSharedPointer implementation has similar operators without such guards, so in reality these compilers may not have worked with Qt 4.6+ either. Change-Id: I208f3cde7c689770ae15245a555e3a58b749a8a3 Reviewed-by: Olivier Goffart Reviewed-by: Thiago Macieira --- src/corelib/kernel/qpointer.h | 40 ---------------------------------------- 1 file changed, 40 deletions(-) (limited to 'src/corelib/kernel/qpointer.h') diff --git a/src/corelib/kernel/qpointer.h b/src/corelib/kernel/qpointer.h index e84900e3b1..385bc2814b 100644 --- a/src/corelib/kernel/qpointer.h +++ b/src/corelib/kernel/qpointer.h @@ -103,8 +103,6 @@ public: }; template Q_DECLARE_TYPEINFO_BODY(QPointer, Q_MOVABLE_TYPE); -#if (!defined(Q_CC_SUN) || (__SUNPRO_CC >= 0x580)) // ambiguity between const T * and T * - template inline bool operator==(const T *o, const QPointer &p) { return o == p.operator->(); } @@ -113,18 +111,6 @@ template inline bool operator==(const QPointer &p, const T *o) { return p.operator->() == o; } -#else - -template -inline bool operator==(const void *o, const QPointer &p) -{ return o == p.operator->(); } - -template -inline bool operator==(const QPointer &p, const void *o) -{ return p.operator->() == o; } - -#endif - template inline bool operator==(T *o, const QPointer &p) { return o == p.operator->(); } @@ -137,9 +123,6 @@ template inline bool operator==(const QPointer &p1, const QPointer &p2) { return p1.operator->() == p2.operator->(); } - -#if (!defined(Q_CC_SUN) || (__SUNPRO_CC >= 0x580)) // ambiguity between const T * and T * - template inline bool operator!=(const T *o, const QPointer &p) { return o != p.operator->(); } @@ -148,18 +131,6 @@ template inline bool operator!= (const QPointer &p, const T *o) { return p.operator->() != o; } -#else - -template -inline bool operator!= (const void *o, const QPointer &p) -{ return o != p.operator->(); } - -template -inline bool operator!= (const QPointer &p, const void *o) -{ return p.operator->() != o; } - -#endif - template inline bool operator!=(T *o, const QPointer &p) { return o != p.operator->(); } @@ -172,17 +143,6 @@ template inline bool operator!= (const QPointer &p1, const QPointer &p2) { return p1.operator->() != p2.operator->() ; } -// Make MSVC < 1400 (2005) handle "if (NULL == p)" syntax -#if defined(Q_CC_MSVC) && (_MSC_VER < 1400) -template -inline bool operator== (int i, const QPointer &p) -{ Q_ASSERT(i == 0); return !i && p.isNull(); } - -template -inline bool operator!= (int i, const QPointer &p) -{ Q_ASSERT(i == 0); return !i && !p.isNull(); } -#endif - template QPointer qPointerFromVariant(const QVariant &variant) -- cgit v1.2.3