diff options
Diffstat (limited to 'src/corelib/serialization')
-rw-r--r-- | src/corelib/serialization/qcborvalue.cpp | 4 | ||||
-rw-r--r-- | src/corelib/serialization/qcborvalue.h | 4 | ||||
-rw-r--r-- | src/corelib/serialization/qjsonarray.cpp | 23 | ||||
-rw-r--r-- | src/corelib/serialization/qjsonarray.h | 4 | ||||
-rw-r--r-- | src/corelib/serialization/qjsonobject.cpp | 22 | ||||
-rw-r--r-- | src/corelib/serialization/qjsonobject.h | 4 | ||||
-rw-r--r-- | src/corelib/serialization/qjsonvalue.cpp | 7 | ||||
-rw-r--r-- | src/corelib/serialization/qjsonvalue.h | 4 |
8 files changed, 26 insertions, 46 deletions
diff --git a/src/corelib/serialization/qcborvalue.cpp b/src/corelib/serialization/qcborvalue.cpp index 056e8c07b6..c136e80755 100644 --- a/src/corelib/serialization/qcborvalue.cpp +++ b/src/corelib/serialization/qcborvalue.cpp @@ -1805,7 +1805,7 @@ QCborValue::QCborValue(QCborTag tag, const QCborValue &tv) /*! Copies the contents of \a other into this object. */ -QCborValue::QCborValue(const QCborValue &other) +QCborValue::QCborValue(const QCborValue &other) noexcept : n(other.n), container(other.container), t(other.t) { if (container) @@ -1899,7 +1899,7 @@ void QCborValue::dispose() /*! Replaces the contents of this QCborObject with a copy of \a other. */ -QCborValue &QCborValue::operator=(const QCborValue &other) +QCborValue &QCborValue::operator=(const QCborValue &other) noexcept { n = other.n; assignContainer(container, other.container); diff --git a/src/corelib/serialization/qcborvalue.h b/src/corelib/serialization/qcborvalue.h index a83a36a3d8..ff4a0fd104 100644 --- a/src/corelib/serialization/qcborvalue.h +++ b/src/corelib/serialization/qcborvalue.h @@ -139,12 +139,12 @@ public: // make sure const char* doesn't go call the bool constructor QCborValue(const void *) = delete; - QCborValue(const QCborValue &other); + QCborValue(const QCborValue &other) noexcept; QCborValue(QCborValue &&other) noexcept : n(other.n), container(qExchange(other.container, nullptr)), t(qExchange(other.t, Undefined)) { } - QCborValue &operator=(const QCborValue &other); + QCborValue &operator=(const QCborValue &other) noexcept; QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QCborValue) void swap(QCborValue &other) noexcept diff --git a/src/corelib/serialization/qjsonarray.cpp b/src/corelib/serialization/qjsonarray.cpp index 167b6a3a77..33f4d51b5f 100644 --- a/src/corelib/serialization/qjsonarray.cpp +++ b/src/corelib/serialization/qjsonarray.cpp @@ -138,11 +138,13 @@ QJsonArray::QJsonArray(std::initializer_list<QJsonValue> args) Since QJsonArray is implicitly shared, the copy is shallow as long as the object doesn't get modified. */ -QJsonArray::QJsonArray(const QJsonArray &other) -{ - a = other.a; -} +QJsonArray::QJsonArray(const QJsonArray &other) noexcept = default; + +/*! + \since 5.10 + Move-constructs a QJsonArray from \a other. +*/ QJsonArray::QJsonArray(QJsonArray &&other) noexcept : a(other.a) { @@ -152,18 +154,7 @@ QJsonArray::QJsonArray(QJsonArray &&other) noexcept /*! Assigns \a other to this array. */ -QJsonArray &QJsonArray::operator =(const QJsonArray &other) -{ - a = other.a; - return *this; -} - -/*! - \fn QJsonArray::QJsonArray(QJsonArray &&other) - \since 5.10 - - Move-constructs a QJsonArray from \a other. -*/ +QJsonArray &QJsonArray::operator =(const QJsonArray &other) noexcept = default; /*! \fn QJsonArray &QJsonArray::operator =(QJsonArray &&other) diff --git a/src/corelib/serialization/qjsonarray.h b/src/corelib/serialization/qjsonarray.h index ec36d384f6..af4ac9fd37 100644 --- a/src/corelib/serialization/qjsonarray.h +++ b/src/corelib/serialization/qjsonarray.h @@ -23,8 +23,8 @@ public: ~QJsonArray(); - QJsonArray(const QJsonArray &other); - QJsonArray &operator =(const QJsonArray &other); + QJsonArray(const QJsonArray &other) noexcept; + QJsonArray &operator =(const QJsonArray &other) noexcept; QJsonArray(QJsonArray &&other) noexcept; diff --git a/src/corelib/serialization/qjsonobject.cpp b/src/corelib/serialization/qjsonobject.cpp index 0a5bafd1cb..7737244a2c 100644 --- a/src/corelib/serialization/qjsonobject.cpp +++ b/src/corelib/serialization/qjsonobject.cpp @@ -122,11 +122,13 @@ QJsonObject::QJsonObject(std::initializer_list<QPair<QString, QJsonValue> > args Since QJsonObject is implicitly shared, the copy is shallow as long as the object does not get modified. */ -QJsonObject::QJsonObject(const QJsonObject &other) -{ - o = other.o; -} +QJsonObject::QJsonObject(const QJsonObject &other) noexcept = default; +/*! + \since 5.10 + + Move-constructs a QJsonObject from \a other. +*/ QJsonObject::QJsonObject(QJsonObject &&other) noexcept : o(other.o) { @@ -136,18 +138,8 @@ QJsonObject::QJsonObject(QJsonObject &&other) noexcept /*! Assigns \a other to this object. */ -QJsonObject &QJsonObject::operator =(const QJsonObject &other) -{ - o = other.o; - return *this; -} +QJsonObject &QJsonObject::operator =(const QJsonObject &other) noexcept = default; -/*! - \fn QJsonObject::QJsonObject(QJsonObject &&other) - \since 5.10 - - Move-constructs a QJsonObject from \a other. -*/ /*! \fn QJsonObject &QJsonObject::operator =(QJsonObject &&other) diff --git a/src/corelib/serialization/qjsonobject.h b/src/corelib/serialization/qjsonobject.h index f5f4d1f47e..d7d3fe549b 100644 --- a/src/corelib/serialization/qjsonobject.h +++ b/src/corelib/serialization/qjsonobject.h @@ -25,8 +25,8 @@ public: ~QJsonObject(); - QJsonObject(const QJsonObject &other); - QJsonObject &operator =(const QJsonObject &other); + QJsonObject(const QJsonObject &other) noexcept; + QJsonObject &operator =(const QJsonObject &other) noexcept; QJsonObject(QJsonObject &&other) noexcept; diff --git a/src/corelib/serialization/qjsonvalue.cpp b/src/corelib/serialization/qjsonvalue.cpp index ef07dcdc3b..5383addb70 100644 --- a/src/corelib/serialization/qjsonvalue.cpp +++ b/src/corelib/serialization/qjsonvalue.cpp @@ -247,15 +247,12 @@ QJsonValue::~QJsonValue() = default; /*! Creates a copy of \a other. */ -QJsonValue::QJsonValue(const QJsonValue &other) - : value(other.value) -{ -} +QJsonValue::QJsonValue(const QJsonValue &other) noexcept = default; /*! Assigns the value stored in \a other to this object. */ -QJsonValue &QJsonValue::operator =(const QJsonValue &other) +QJsonValue &QJsonValue::operator =(const QJsonValue &other) noexcept { QJsonValue copy(other); swap(copy); diff --git a/src/corelib/serialization/qjsonvalue.h b/src/corelib/serialization/qjsonvalue.h index 3aecaa6126..dddc8a0c30 100644 --- a/src/corelib/serialization/qjsonvalue.h +++ b/src/corelib/serialization/qjsonvalue.h @@ -51,8 +51,8 @@ public: ~QJsonValue(); - QJsonValue(const QJsonValue &other); - QJsonValue &operator =(const QJsonValue &other); + QJsonValue(const QJsonValue &other) noexcept; + QJsonValue &operator =(const QJsonValue &other) noexcept; QJsonValue(QJsonValue &&other) noexcept; |