diff options
-rw-r--r-- | src/corelib/global/qtypeinfo.h | 3 | ||||
-rw-r--r-- | src/corelib/kernel/qmetatype.h | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index b9159a2e1a..4b29d0bf53 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -250,11 +250,14 @@ struct is_container<T, std::void_t< // Checks the existence of the comparison operator for the class itself +QT_WARNING_PUSH +QT_WARNING_DISABLE_FLOAT_COMPARE template <typename, typename = void> struct has_operator_equal : std::false_type {}; template <typename T> struct has_operator_equal<T, std::void_t<decltype(bool(std::declval<const T&>() == std::declval<const T&>()))>> : std::true_type {}; +QT_WARNING_POP // Two forward declarations template<typename T, bool = is_container<T>::value> diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 18d911d33b..3b84327e91 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -2121,8 +2121,11 @@ struct BuiltinMetaType<T, std::enable_if_t<QMetaTypeId2<T>::IsBuiltIn>> template<typename T, bool = (QTypeTraits::has_operator_equal_v<T> && !std::is_pointer_v<T>)> struct QEqualityOperatorForType { +QT_WARNING_PUSH +QT_WARNING_DISABLE_FLOAT_COMPARE static bool equals(const QMetaTypeInterface *, const void *a, const void *b) { return *reinterpret_cast<const T *>(a) == *reinterpret_cast<const T *>(b); } +QT_WARNING_POP }; template<typename T> |