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 <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Stephen Kelly 2013-02-10 14:51:43 +01:00 committed by The Qt Project
parent 83e6d1fe60
commit c21ed8ca1f

View File

@ -103,8 +103,6 @@ public:
};
template <class T> Q_DECLARE_TYPEINFO_BODY(QPointer<T>, Q_MOVABLE_TYPE);
#if (!defined(Q_CC_SUN) || (__SUNPRO_CC >= 0x580)) // ambiguity between const T * and T *
template <class T>
inline bool operator==(const T *o, const QPointer<T> &p)
{ return o == p.operator->(); }
@ -113,18 +111,6 @@ template<class T>
inline bool operator==(const QPointer<T> &p, const T *o)
{ return p.operator->() == o; }
#else
template<class T>
inline bool operator==(const void *o, const QPointer<T> &p)
{ return o == p.operator->(); }
template<class T>
inline bool operator==(const QPointer<T> &p, const void *o)
{ return p.operator->() == o; }
#endif
template <class T>
inline bool operator==(T *o, const QPointer<T> &p)
{ return o == p.operator->(); }
@ -137,9 +123,6 @@ template<class T>
inline bool operator==(const QPointer<T> &p1, const QPointer<T> &p2)
{ return p1.operator->() == p2.operator->(); }
#if (!defined(Q_CC_SUN) || (__SUNPRO_CC >= 0x580)) // ambiguity between const T * and T *
template <class T>
inline bool operator!=(const T *o, const QPointer<T> &p)
{ return o != p.operator->(); }
@ -148,18 +131,6 @@ template<class T>
inline bool operator!= (const QPointer<T> &p, const T *o)
{ return p.operator->() != o; }
#else
template<class T>
inline bool operator!= (const void *o, const QPointer<T> &p)
{ return o != p.operator->(); }
template<class T>
inline bool operator!= (const QPointer<T> &p, const void *o)
{ return p.operator->() != o; }
#endif
template <class T>
inline bool operator!=(T *o, const QPointer<T> &p)
{ return o != p.operator->(); }
@ -172,17 +143,6 @@ template<class T>
inline bool operator!= (const QPointer<T> &p1, const QPointer<T> &p2)
{ return p1.operator->() != p2.operator->() ; }
// Make MSVC < 1400 (2005) handle "if (NULL == p)" syntax
#if defined(Q_CC_MSVC) && (_MSC_VER < 1400)
template<class T>
inline bool operator== (int i, const QPointer<T> &p)
{ Q_ASSERT(i == 0); return !i && p.isNull(); }
template<class T>
inline bool operator!= (int i, const QPointer<T> &p)
{ Q_ASSERT(i == 0); return !i && !p.isNull(); }
#endif
template<typename T>
QPointer<T>
qPointerFromVariant(const QVariant &variant)