diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-06-06 00:26:27 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-06-06 13:30:34 +0200 |
commit | 1f80d1a5eb954856c29be75e77aad267b59ab3d0 (patch) | |
tree | 52ed3085020014576d61da5b419edbf5c986ac60 /src/corelib/kernel/qvariant.h | |
parent | 725c37ffe0cc46e4140f5dab46df3cb14337f454 (diff) |
QVariant: use std::addressof instead of operator&
Change-Id: If7172e9e0e213d99f0c54b387dde8f9e163109d0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/kernel/qvariant.h')
-rw-r--r-- | src/corelib/kernel/qvariant.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index 2cc09ba616..1f79bdfd89 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -53,6 +53,8 @@ #include <QtCore/qbytearraylist.h> #endif +#include <memory> + #if __has_include(<variant>) && __cplusplus >= 201703L #include <variant> #elif defined(Q_CLANG_QDOC) @@ -362,7 +364,7 @@ class Q_CORE_EXPORT QVariant template<typename T> static inline QVariant fromValue(const T &value) { - return QVariant(QMetaType::fromType<T>(), &value); + return QVariant(QMetaType::fromType<T>(), std::addressof(value)); } #if (__has_include(<variant>) && __cplusplus >= 201703L) || defined(Q_CLANG_QDOC) |