QScoped(Array)Pointer: use the rule of 5

CodeChecker complains regarding the two classes not having all
the special 5 declared, so do it.

Change-Id: I76d562c52f89a24aec9f155c2be62f8844f1f4a7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
bb10
Giuseppe D'Angelo 2021-09-20 13:17:10 +02:00
parent b32698b3a9
commit bf5d5bfc0c
1 changed files with 3 additions and 2 deletions

View File

@ -219,7 +219,7 @@ protected:
T *d;
private:
Q_DISABLE_COPY(QScopedPointer)
Q_DISABLE_COPY_MOVE(QScopedPointer)
};
template <typename T, typename Cleanup = QScopedPointerArrayDeleter<T> >
@ -229,6 +229,7 @@ class [[nodiscard]] QScopedArrayPointer : public QScopedPointer<T, Cleanup>
using if_same_type = typename std::enable_if<std::is_same<typename std::remove_cv<T>::type, Ptr>::value, bool>::type;
public:
inline QScopedArrayPointer() : QScopedPointer<T, Cleanup>(nullptr) {}
inline ~QScopedArrayPointer() = default;
template <typename D, if_same_type<D> = true>
explicit QScopedArrayPointer(D *p)
@ -265,7 +266,7 @@ private:
// allowed and results in undefined behavior.
}
Q_DISABLE_COPY(QScopedArrayPointer)
Q_DISABLE_COPY_MOVE(QScopedArrayPointer)
};
#if QT_DEPRECATED_SINCE(6, 2)