QString/QByteArray: = default the move ctors
Instead of relying on implicit construction of the d-pointer and then swapping that with other.d (using overly-generic qSwap(), no less), simply let the compiler do The Right Thing™ via QArrayDataPointer's move constructor. Pick-to: 6.3 6.2 Task-number: QTBUG-97601 Change-Id: I3be30f99f6fb0e17d3550edbe64cbe80880e604a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
156afbc9b8
commit
78891e5390
@ -121,7 +121,7 @@ public:
|
||||
QByteArray &operator=(const QByteArray &) noexcept;
|
||||
QByteArray &operator=(const char *str);
|
||||
inline QByteArray(QByteArray && other) noexcept
|
||||
{ qSwap(d, other.d); }
|
||||
= default;
|
||||
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QByteArray)
|
||||
inline void swap(QByteArray &other) noexcept
|
||||
{ d.swap(other.d); }
|
||||
|
@ -462,7 +462,7 @@ public:
|
||||
QString &operator=(const QString &) noexcept;
|
||||
QString &operator=(QLatin1String latin1);
|
||||
inline QString(QString &&other) noexcept
|
||||
{ qSwap(d, other.d); }
|
||||
= default;
|
||||
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QString)
|
||||
void swap(QString &other) noexcept { d.swap(other.d); }
|
||||
inline qsizetype size() const { return d.size; }
|
||||
|
Loading…
Reference in New Issue
Block a user