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:
parent
c2b0287a44
commit
f805db7c61
@ -373,11 +373,6 @@ QTimeZone::Data::Data(const Data &other) noexcept
|
|||||||
d = other.d;
|
d = other.d;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTimeZone::Data::Data(Data &&other) noexcept
|
|
||||||
: d(std::exchange(other.d, nullptr))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QTimeZone::Data::Data(QTimeZonePrivate *dptr) noexcept
|
QTimeZone::Data::Data(QTimeZonePrivate *dptr) noexcept
|
||||||
: d(dptr)
|
: 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.
|
Move constructor of this from \a other.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
QTimeZone::QTimeZone(QTimeZone &&other) noexcept
|
|
||||||
: d(std::move(other.d))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Destroys the time zone.
|
Destroys the time zone.
|
||||||
*/
|
*/
|
||||||
|
@ -58,7 +58,7 @@ class Q_CORE_EXPORT QTimeZone
|
|||||||
Data() noexcept;
|
Data() noexcept;
|
||||||
Data(ShortData sd) : s(sd) {}
|
Data(ShortData sd) : s(sd) {}
|
||||||
Data(const Data &other) noexcept;
|
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=(const Data &other) noexcept;
|
||||||
Data &operator=(Data &&other) noexcept { swap(other); return *this; }
|
Data &operator=(Data &&other) noexcept { swap(other); return *this; }
|
||||||
~Data();
|
~Data();
|
||||||
@ -105,7 +105,7 @@ public:
|
|||||||
#endif // timezone backends
|
#endif // timezone backends
|
||||||
|
|
||||||
QTimeZone(const QTimeZone &other) noexcept;
|
QTimeZone(const QTimeZone &other) noexcept;
|
||||||
QTimeZone(QTimeZone &&other) noexcept;
|
QTimeZone(QTimeZone &&other) noexcept : d(std::move(other.d)) {}
|
||||||
~QTimeZone();
|
~QTimeZone();
|
||||||
|
|
||||||
QTimeZone &operator=(const QTimeZone &other);
|
QTimeZone &operator=(const QTimeZone &other);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user