QPointer: make swap(lhs, rhs) a hidden friend
This is how we like our free functions these days. Task-number: QTBUG-87973 Change-Id: I55b5f2674d24c7b76b8dc425a4f1c5520b8c1ec4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
aeeb77650f
commit
1ba4f73692
|
|
@ -77,6 +77,9 @@ public:
|
|||
inline void clear()
|
||||
{ wp.clear(); }
|
||||
|
||||
friend void swap(QPointer &lhs, QPointer &rhs) noexcept
|
||||
{ lhs.swap(rhs); }
|
||||
|
||||
#define DECLARE_COMPARE_SET(T1, A1, T2, A2) \
|
||||
friend bool operator==(T1, T2) \
|
||||
{ return A1 == A2; } \
|
||||
|
|
@ -109,10 +112,6 @@ qPointerFromVariant(const QVariant &variant)
|
|||
return QPointer<T>{qobject_cast<T*>(QtPrivate::EnableInternalData::internalData(wp))};
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline void swap(QPointer<T> &p1, QPointer<T> &p2) noexcept
|
||||
{ p1.swap(p2); }
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_QOBJECT
|
||||
|
|
|
|||
Loading…
Reference in New Issue