QBindingObserverPtr: add noexcept

QVarLengthArray checks for is_nothrow_move_constructible_v, though only
uses that information for its own noexceptness.

Pick-to: 6.4
Change-Id: I03c81e4da75fbe287d491843716d26e1acac8310
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
bb10
Fabian Kosmale 2022-08-02 08:20:17 +02:00
parent a17d6f869b
commit 245da0762e
1 changed files with 5 additions and 5 deletions

View File

@ -46,13 +46,13 @@ public:
Q_DISABLE_COPY(QBindingObserverPtr);
void swap(QBindingObserverPtr &other) noexcept
{ qt_ptr_swap(d, other.d); }
QBindingObserverPtr(QBindingObserverPtr &&other) : d(std::exchange(other.d, nullptr)) {}
QBindingObserverPtr(QBindingObserverPtr &&other) noexcept : d(std::exchange(other.d, nullptr)) {}
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QBindingObserverPtr);
inline QBindingObserverPtr(QPropertyObserver *observer);
inline QBindingObserverPtr(QPropertyObserver *observer) noexcept;
inline ~QBindingObserverPtr();
inline QPropertyBindingPrivate *binding() const;
inline QPropertyBindingPrivate *binding() const noexcept;
inline QPropertyObserver *operator ->();
};
@ -893,7 +893,7 @@ inline QPropertyObserverNodeProtector::~QPropertyObserverNodeProtector()
d.unlink_fast();
}
QBindingObserverPtr::QBindingObserverPtr(QPropertyObserver *observer) : d(observer)
QBindingObserverPtr::QBindingObserverPtr(QPropertyObserver *observer) noexcept : d(observer)
{
Q_ASSERT(d);
QPropertyObserverPointer{d}.binding()->addRef();
@ -901,7 +901,7 @@ QBindingObserverPtr::QBindingObserverPtr(QPropertyObserver *observer) : d(observ
QBindingObserverPtr::~QBindingObserverPtr() { if (d) QPropertyObserverPointer{d}.binding()->deref(); }
QPropertyBindingPrivate *QBindingObserverPtr::binding() const { return QPropertyObserverPointer{d}.binding(); }
QPropertyBindingPrivate *QBindingObserverPtr::binding() const noexcept { return QPropertyObserverPointer{d}.binding(); }
QPropertyObserver *QBindingObserverPtr::operator->() { return d; }