Make the default constructor of QMetaType constexpr

And inline the copy constructor forwarding to another one.

Change-Id: I3c4f76f7b14edd84f512ef0687416b20940e333a
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
bb10
Lars Knoll 2020-06-15 08:57:53 +02:00
parent 68387e485c
commit 87bc5f7a7c
2 changed files with 2 additions and 5 deletions

View File

@ -683,9 +683,6 @@ QMetaType::QMetaType(QtPrivate::QMetaTypeInterface *d) : d_ptr(d)
d_ptr->ref.ref();
}
QMetaType::QMetaType() : d_ptr(nullptr) {}
QMetaType::QMetaType(const QMetaType &other) : QMetaType(other.d_ptr) {}
QMetaType &QMetaType::operator=(const QMetaType &other)
{
if (d_ptr != other.d_ptr) {

View File

@ -546,9 +546,9 @@ public:
explicit QMetaType(int type);
explicit QMetaType(QtPrivate::QMetaTypeInterface *d);
QMetaType();
constexpr QMetaType() : d_ptr(nullptr) {}
~QMetaType();
QMetaType(const QMetaType &other);
QMetaType(const QMetaType &other) : QMetaType(other.d_ptr) {}
QMetaType &operator=(const QMetaType &);
QMetaType(QMetaType &&other) : d_ptr(other.d_ptr) { other.d_ptr = nullptr; }
QMetaType &operator=(QMetaType &&other)