QBitArray: apply Rule Of Zero

Can't do it now, because this non-polymorphic class is exported
wholesale, so removing the SMFs would be BiC. But pre-program for
Qt 7, so we don't forget again.

Change-Id: I36420dbaeda53391d304cf6832167f6157c22e35
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2024-01-29 07:54:47 +01:00
parent 0808beace3
commit 7081531173
2 changed files with 7 additions and 0 deletions

View File

@ -77,6 +77,7 @@ QT_BEGIN_NAMESPACE
\sa QByteArray, QList
*/
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
/*!
\fn QBitArray::QBitArray(QBitArray &&other)
@ -85,6 +86,7 @@ QT_BEGIN_NAMESPACE
\since 5.2
*/
#endif
/*! \fn QBitArray::QBitArray()
@ -467,6 +469,7 @@ quint32 QBitArray::toUInt32(QSysInfo::Endian endianness, bool *ok) const noexcep
\overload
*/
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
/*! \fn QBitArray::QBitArray(const QBitArray &other) noexcept
Constructs a copy of \a other.
@ -491,6 +494,7 @@ quint32 QBitArray::toUInt32(QSysInfo::Endian endianness, bool *ok) const noexcep
Moves \a other to this bit array and returns a reference to
this bit array.
*/
#endif // Qt 6
/*! \fn void QBitArray::swap(QBitArray &other)
\since 4.8

View File

@ -63,10 +63,13 @@ class Q_CORE_EXPORT QBitArray
public:
inline QBitArray() noexcept {}
explicit QBitArray(qsizetype size, bool val = false);
// Rule Of Zero applies
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
QBitArray(const QBitArray &other) noexcept : d(other.d) {}
inline QBitArray &operator=(const QBitArray &other) noexcept { d = other.d; return *this; }
inline QBitArray(QBitArray &&other) noexcept : d(std::move(other.d)) {}
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QBitArray)
#endif // Qt 6
void swap(QBitArray &other) noexcept { d.swap(other.d); }