aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/qml/ftw/qbipointer_p.h7
-rw-r--r--src/qml/qml/ftw/qqmlrefcount_p.h4
2 files changed, 6 insertions, 5 deletions
diff --git a/src/qml/qml/ftw/qbipointer_p.h b/src/qml/qml/ftw/qbipointer_p.h
index db272d41f8..24b4335367 100644
--- a/src/qml/qml/ftw/qbipointer_p.h
+++ b/src/qml/qml/ftw/qbipointer_p.h
@@ -86,6 +86,8 @@ public:
QBiPointer<T, T2> &operator=(const QBiPointer<T, T2> &o) noexcept = default;
QBiPointer<T, T2> &operator=(QBiPointer<T, T2> &&o) noexcept = default;
+ void swap(QBiPointer &other) noexcept { std::swap(ptr_value, other.ptr_value); }
+
inline QBiPointer(T *);
inline QBiPointer(T2 *);
@@ -116,10 +118,7 @@ public:
return !(ptr1 == ptr2);
}
- friend inline void swap(QBiPointer<T, T2> &ptr1, QBiPointer<T, T2> &ptr2) noexcept
- {
- qSwap(ptr1.ptr_value, ptr2.ptr_value);
- }
+ friend void swap(QBiPointer &lhs, QBiPointer &rhs) noexcept { lhs.swap(rhs); }
inline T *asT1() const;
inline T2 *asT2() const;
diff --git a/src/qml/qml/ftw/qqmlrefcount_p.h b/src/qml/qml/ftw/qqmlrefcount_p.h
index cb0374d8b6..bb0b0ba2a6 100644
--- a/src/qml/qml/ftw/qqmlrefcount_p.h
+++ b/src/qml/qml/ftw/qqmlrefcount_p.h
@@ -88,6 +88,8 @@ public:
inline QQmlRefPointer(QQmlRefPointer<T> &&);
inline ~QQmlRefPointer();
+ void swap(QQmlRefPointer &other) noexcept { qt_ptr_swap(o, other.o); }
+
inline QQmlRefPointer<T> &operator=(const QQmlRefPointer<T> &o);
inline QQmlRefPointer<T> &operator=(QQmlRefPointer<T> &&o);
@@ -198,7 +200,7 @@ template <class T>
QQmlRefPointer<T> &QQmlRefPointer<T>::operator=(QQmlRefPointer<T> &&other)
{
QQmlRefPointer<T> m(std::move(other));
- qSwap(o, m.o);
+ swap(m);
return *this;
}