From 7cb215938880e33a76092c33d29f85c12f4209ce Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 28 Oct 2021 12:33:45 +0200 Subject: [PATCH] Match documentation of shared pointers to new definitions We also have move semantics and noexcept. Pick-to: 6.2 Change-Id: Idcb1d39f79ff45738c641f8dd07fb71cf32d9aca Reviewed-by: Thiago Macieira --- src/corelib/tools/qsharedpointer.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qsharedpointer.h b/src/corelib/tools/qsharedpointer.h index 82eb80beffa..a7365aecf15 100644 --- a/src/corelib/tools/qsharedpointer.h +++ b/src/corelib/tools/qsharedpointer.h @@ -76,13 +76,15 @@ public: template QSharedPointer(std::nullptr_t, Deleter d); QSharedPointer(const QSharedPointer &other); QSharedPointer(const QWeakPointer &other); + QSharedPointer(QSharedPointer &&other) noexcept; ~QSharedPointer() { } QSharedPointer &operator=(const QSharedPointer &other); + QSharedPointer &operator=(QSharedPointer &&other) noexcept; QSharedPointer &operator=(const QWeakPointer &other); - void swap(QSharedPointer &other); + void swap(QSharedPointer &other) noexcept; QWeakPointer toWeakRef() const; @@ -114,18 +116,20 @@ public: // constructors: QWeakPointer(); - QWeakPointer(const QWeakPointer &other); + QWeakPointer(const QWeakPointer &other) noexcept; + QWeakPointer(QWeakPointer &&other) noexcept; QWeakPointer(const QSharedPointer &other); ~QWeakPointer(); - QWeakPointer &operator=(const QWeakPointer &other); + QWeakPointer &operator=(const QWeakPointer &other) noexcept; + QWeakPointer &operator=(QWeakPointer &&other) noexcept; QWeakPointer &operator=(const QSharedPointer &other); QWeakPointer(const QObject *other); QWeakPointer &operator=(const QObject *other); - void swap(QWeakPointer &other); + void swap(QWeakPointer &other) noexcept; T *data() const; void clear();