diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-07-22 15:24:22 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-07-27 12:35:50 -0700 |
commit | 3da89227feac3ba10275da762726e371617b611f (patch) | |
tree | 69e01c7d7a8092c7d45176e64d625d89fb32f3a7 /src/corelib/kernel/qvariant.h | |
parent | b665ffbce2bf6af92d1189cfadc36d356e21fcfa (diff) |
QVariant: replace v_construct with a Private template constructor
It's effectively the same and no one is using v_construct().
Change-Id: I3859764fed084846bcb0fffd1704470801c9e6e7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel/qvariant.h')
-rw-r--r-- | src/corelib/kernel/qvariant.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index dc73f46af5..aca2db2cbe 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -445,7 +445,8 @@ public: quintptr is_null : 1; quintptr packedType : sizeof(QMetaType) * 8 - 2; - Private() noexcept : is_shared(false), is_null(true), packedType(0) {} + constexpr Private() noexcept : is_shared(false), is_null(true), packedType(0) {} + template <typename T> explicit Private(std::piecewise_construct_t, const T &t); explicit Private(QMetaType type) noexcept : is_shared(false), is_null(false) { quintptr mt = quintptr(type.d_ptr); @@ -464,9 +465,6 @@ public: template<typename T> const T &get() const { return *static_cast<const T *>(CanUseInternalSpace<T> ? &data.data : data.shared->data()); } - template<typename T> - void set(const T &t) - { *static_cast<T *>(CanUseInternalSpace<T> ? &data.data : data.shared->data()) = t; } inline const QtPrivate::QMetaTypeInterface* typeInterface() const { |