From 87bc5f7a7ca6240845cc59d877824c7de01d614d Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 15 Jun 2020 08:57:53 +0200 Subject: [PATCH] Make the default constructor of QMetaType constexpr And inline the copy constructor forwarding to another one. Change-Id: I3c4f76f7b14edd84f512ef0687416b20940e333a Reviewed-by: Karsten Heimrich --- src/corelib/kernel/qmetatype.cpp | 3 --- src/corelib/kernel/qmetatype.h | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index dfb6842d13..262afb2677 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -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) { diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index d964c16915..f59acf2d54 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -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)