QVariant: use std::addressof instead of operator&
Change-Id: If7172e9e0e213d99f0c54b387dde8f9e163109d0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
parent
725c37ffe0
commit
1f80d1a5eb
@ -53,6 +53,8 @@
|
|||||||
#include <QtCore/qbytearraylist.h>
|
#include <QtCore/qbytearraylist.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#if __has_include(<variant>) && __cplusplus >= 201703L
|
#if __has_include(<variant>) && __cplusplus >= 201703L
|
||||||
#include <variant>
|
#include <variant>
|
||||||
#elif defined(Q_CLANG_QDOC)
|
#elif defined(Q_CLANG_QDOC)
|
||||||
@ -362,7 +364,7 @@ class Q_CORE_EXPORT QVariant
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
static inline QVariant fromValue(const T &value)
|
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)
|
#if (__has_include(<variant>) && __cplusplus >= 201703L) || defined(Q_CLANG_QDOC)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user