Inline two move-constructors in qtimezone.h

The move-constructors for QTimeZone and QTimeZone::Data are trivial so
can be inlined. Requested by Marc Mutz in 6.5 API review.

Pick-to: 6.5
Change-Id: Id59dc95e0da061187d9db8cf0a5ab82fcece1694
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Edward Welbourne 2023-01-17 14:34:51 +01:00
parent c2b0287a44
commit f805db7c61
2 changed files with 4 additions and 12 deletions

View File

@ -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.
*/

View File

@ -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);