diff --git a/src/corelib/time/qtimezone.cpp b/src/corelib/time/qtimezone.cpp index 3bd7489ebb7..7c1088768cd 100644 --- a/src/corelib/time/qtimezone.cpp +++ b/src/corelib/time/qtimezone.cpp @@ -373,11 +373,6 @@ QTimeZone::Data::Data(const Data &other) noexcept d = other.d; } -QTimeZone::Data::Data(Data &&other) noexcept - : d(std::exchange(other.d, nullptr)) -{ -} - QTimeZone::Data::Data(QTimeZonePrivate *dptr) noexcept : d(dptr) { @@ -674,14 +669,11 @@ QTimeZone::QTimeZone(const QTimeZone &other) noexcept } /*! + \fn QTimeZone::QTimeZone(QTimeZone &&other) noexcept + Move constructor of this from \a other. */ -QTimeZone::QTimeZone(QTimeZone &&other) noexcept - : d(std::move(other.d)) -{ -} - /*! Destroys the time zone. */ diff --git a/src/corelib/time/qtimezone.h b/src/corelib/time/qtimezone.h index a4857ca95bf..20b6df2ad54 100644 --- a/src/corelib/time/qtimezone.h +++ b/src/corelib/time/qtimezone.h @@ -58,7 +58,7 @@ class Q_CORE_EXPORT QTimeZone Data() noexcept; Data(ShortData sd) : s(sd) {} Data(const Data &other) noexcept; - Data(Data &&other) noexcept; + Data(Data &&other) noexcept : d(std::exchange(other.d, nullptr)) {} Data &operator=(const Data &other) noexcept; Data &operator=(Data &&other) noexcept { swap(other); return *this; } ~Data(); @@ -105,7 +105,7 @@ public: #endif // timezone backends QTimeZone(const QTimeZone &other) noexcept; - QTimeZone(QTimeZone &&other) noexcept; + QTimeZone(QTimeZone &&other) noexcept : d(std::move(other.d)) {} ~QTimeZone(); QTimeZone &operator=(const QTimeZone &other);