From 98a263fb10d679bfa1d5baa4dc91383ccbd3f3a4 Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Fri, 13 Jan 2023 18:02:01 +0100 Subject: Make move-constructors and destructors of value classes inline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The QT_{DECLARE,DEFINE}_QESDP_SPECIALIZATION_DTOR pair of macros makes it possible even when using a shared d-pointer. Change-Id: I924524d88d971aeaa9aa702a6553b2261a807496 Reviewed-by: Qt CI Bot Reviewed-by: André Hartmann Reviewed-by: Marc Mutz Reviewed-by: Alex Blasche (cherry picked from commit e9c052f3cc49ff1ad0a73f9b17f2bae52d671a66) Reviewed-by: Qt Cherry-pick Bot --- src/serialbus/qcanmessagedescription.cpp | 6 ++++-- src/serialbus/qcanmessagedescription.h | 4 ++-- src/serialbus/qcansignaldescription.cpp | 6 ++++-- src/serialbus/qcansignaldescription.h | 4 ++-- src/serialbus/qcanuniqueiddescription.cpp | 6 ++++-- src/serialbus/qcanuniqueiddescription.h | 4 ++-- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/serialbus/qcanmessagedescription.cpp b/src/serialbus/qcanmessagedescription.cpp index fd37cfd..d1b0f7c 100644 --- a/src/serialbus/qcanmessagedescription.cpp +++ b/src/serialbus/qcanmessagedescription.cpp @@ -63,18 +63,20 @@ QCanMessageDescription::QCanMessageDescription(const QCanMessageDescription &oth } /*! + \fn QCanMessageDescription::QCanMessageDescription(QCanMessageDescription &&other) noexcept + Creates a message description by moving from \a other. \note The moved-from QCanMessageDescription object can only be destroyed or assigned to. The effect of calling other functions than the destructor or one of the assignment operators is undefined. */ -QCanMessageDescription::QCanMessageDescription(QCanMessageDescription &&other) noexcept = default; /*! + \fn QCanMessageDescription::~QCanMessageDescription() + Destroys this message description. */ -QCanMessageDescription::~QCanMessageDescription() = default; QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QCanMessageDescriptionPrivate) diff --git a/src/serialbus/qcanmessagedescription.h b/src/serialbus/qcanmessagedescription.h index 68e9c04..7e7fb19 100644 --- a/src/serialbus/qcanmessagedescription.h +++ b/src/serialbus/qcanmessagedescription.h @@ -22,8 +22,8 @@ class Q_SERIALBUS_EXPORT QCanMessageDescription public: QCanMessageDescription(); QCanMessageDescription(const QCanMessageDescription &other); - QCanMessageDescription(QCanMessageDescription &&other) noexcept; - ~QCanMessageDescription(); + QCanMessageDescription(QCanMessageDescription &&other) noexcept = default; + ~QCanMessageDescription() = default; QCanMessageDescription &operator=(const QCanMessageDescription &other); QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QCanMessageDescription) diff --git a/src/serialbus/qcansignaldescription.cpp b/src/serialbus/qcansignaldescription.cpp index 83c3ca0..7a016ad 100644 --- a/src/serialbus/qcansignaldescription.cpp +++ b/src/serialbus/qcansignaldescription.cpp @@ -184,18 +184,20 @@ QCanSignalDescription::QCanSignalDescription(const QCanSignalDescription &other) } /*! + \fn QCanSignalDescription::QCanSignalDescription(QCanSignalDescription &&other) noexcept + Creates a signal description by moving from \a other. \note The moved-from QCanSignalDescription object can only be destroyed or assigned to. The effect of calling other functions than the destructor or one of the assignment operators is undefined. */ -QCanSignalDescription::QCanSignalDescription(QCanSignalDescription &&other) noexcept = default; /*! + \fn QCanSignalDescription::~QCanSignalDescription() + Destroys this signal description. */ -QCanSignalDescription::~QCanSignalDescription() = default; QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QCanSignalDescriptionPrivate) diff --git a/src/serialbus/qcansignaldescription.h b/src/serialbus/qcansignaldescription.h index 4c41d06..aa54419 100644 --- a/src/serialbus/qcansignaldescription.h +++ b/src/serialbus/qcansignaldescription.h @@ -24,8 +24,8 @@ public: QCanSignalDescription(); QCanSignalDescription(const QCanSignalDescription &other); - QCanSignalDescription(QCanSignalDescription &&other) noexcept; - ~QCanSignalDescription(); + QCanSignalDescription(QCanSignalDescription &&other) noexcept = default; + ~QCanSignalDescription() = default; QCanSignalDescription &operator=(const QCanSignalDescription &other); QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QCanSignalDescription) diff --git a/src/serialbus/qcanuniqueiddescription.cpp b/src/serialbus/qcanuniqueiddescription.cpp index 2947fd4..3096b05 100644 --- a/src/serialbus/qcanuniqueiddescription.cpp +++ b/src/serialbus/qcanuniqueiddescription.cpp @@ -62,18 +62,20 @@ QCanUniqueIdDescription::QCanUniqueIdDescription(const QCanUniqueIdDescription & } /*! + \fn QCanUniqueIdDescription::QCanUniqueIdDescription(QCanUniqueIdDescription &&other) noexcept + Creates a unique identifier description by moving from \a other. \note The moved-from QCanUniqueIdDescription object can only be destroyed or assigned to. The effect of calling other functions than the destructor or one of the assignment operators is undefined. */ -QCanUniqueIdDescription::QCanUniqueIdDescription(QCanUniqueIdDescription &&other) noexcept = default; /*! + \fn QCanUniqueIdDescription::~QCanUniqueIdDescription() + Destroys this unique identifier description. */ -QCanUniqueIdDescription::~QCanUniqueIdDescription() = default; QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QCanUniqueIdDescriptionPrivate) diff --git a/src/serialbus/qcanuniqueiddescription.h b/src/serialbus/qcanuniqueiddescription.h index ef0c8cd..717b7ac 100644 --- a/src/serialbus/qcanuniqueiddescription.h +++ b/src/serialbus/qcanuniqueiddescription.h @@ -19,8 +19,8 @@ class Q_SERIALBUS_EXPORT QCanUniqueIdDescription public: QCanUniqueIdDescription(); QCanUniqueIdDescription(const QCanUniqueIdDescription &other); - QCanUniqueIdDescription(QCanUniqueIdDescription &&other) noexcept; - ~QCanUniqueIdDescription(); + QCanUniqueIdDescription(QCanUniqueIdDescription &&other) noexcept = default; + ~QCanUniqueIdDescription() = default; QCanUniqueIdDescription &operator=(const QCanUniqueIdDescription &other); QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QCanUniqueIdDescription) -- cgit v1.2.3