summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2024-01-29 07:54:47 +0100
committerMarc Mutz <marc.mutz@qt.io>2024-01-31 21:18:47 +0100
commit7081531173dbb5e7dca5c6cf9359fac8e5961e06 (patch)
tree6f6834151a38919b02f0d160066d8ef2d9bf4829
parent0808beace332631f8100b5700577f10f63e4630c (diff)
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>
-rw-r--r--src/corelib/tools/qbitarray.cpp4
-rw-r--r--src/corelib/tools/qbitarray.h3
2 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp
index ef30b97a6c..12794bd70a 100644
--- a/src/corelib/tools/qbitarray.cpp
+++ b/src/corelib/tools/qbitarray.cpp
@@ -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
diff --git a/src/corelib/tools/qbitarray.h b/src/corelib/tools/qbitarray.h
index 06273a26d7..4a75668a46 100644
--- a/src/corelib/tools/qbitarray.h
+++ b/src/corelib/tools/qbitarray.h
@@ -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); }