diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-07-19 12:53:38 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-07-26 20:12:45 -0700 |
commit | 764d82ceb541f5b0ca812fa451707311b6e6ccc0 (patch) | |
tree | 3c6e8e8e92ecf467f5dec973d37d9e77439394c0 /src/corelib/kernel/qmetatype.h | |
parent | 74fac865cf7c55d3afba1043072ba6cc932d161d (diff) |
QMetaType: add is{Default,Copy,Move}Constructible and isDestructible
Unit tests will come after I've fixed the flags themselves. At this point,
they are wrong.
[ChangeLog][QtCore][QMetaType] Added isDefaultConstructible(),
isCopyConstructible(), isMoveConstructible() and isDestructible().
Change-Id: I3859764fed084846bcb0fffd170353109378e34c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel/qmetatype.h')
-rw-r--r-- | src/corelib/kernel/qmetatype.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index e9599af5bb..28d246d2cf 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -455,6 +455,10 @@ public: QPartialOrdering compare(const void *lhs, const void *rhs) const; bool equals(const void *lhs, const void *rhs) const; + bool isDefaultConstructible() const noexcept { return d_ptr && isDefaultConstructible(d_ptr); } + bool isCopyConstructible() const noexcept { return d_ptr && isCopyConstructible(d_ptr); } + bool isMoveConstructible() const noexcept { return d_ptr && isMoveConstructible(d_ptr); } + bool isDestructible() const noexcept { return d_ptr && isDestructible(d_ptr); } bool isEqualityComparable() const; bool isOrdered() const; @@ -722,6 +726,11 @@ public: const QtPrivate::QMetaTypeInterface *iface() const { return d_ptr; } private: + static bool isDefaultConstructible(const QtPrivate::QMetaTypeInterface *) noexcept Q_DECL_PURE_FUNCTION; + static bool isCopyConstructible(const QtPrivate::QMetaTypeInterface *) noexcept Q_DECL_PURE_FUNCTION; + static bool isMoveConstructible(const QtPrivate::QMetaTypeInterface *) noexcept Q_DECL_PURE_FUNCTION; + static bool isDestructible(const QtPrivate::QMetaTypeInterface *) noexcept Q_DECL_PURE_FUNCTION; + #if QT_CORE_REMOVED_SINCE(6, 5) int idHelper() const; #endif |