diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/corelib/global/qcompare.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/corelib/global/qcompare.h b/src/corelib/global/qcompare.h index 38839e36921..a807e6001c8 100644 --- a/src/corelib/global/qcompare.h +++ b/src/corelib/global/qcompare.h @@ -21,12 +21,6 @@ QT_BEGIN_NAMESPACE -#if defined(Q_CC_MSVC) -#define Q_COMPARE_CAST_IMPLICIT explicit -#else -#define Q_COMPARE_CAST_IMPLICIT Q_IMPLICIT -#endif // Q_CC_MSVC - namespace QtPrivate { using CompareUnderlyingType = qint8; @@ -376,23 +370,6 @@ public: #endif // __cpp_lib_bit_cast } - constexpr Q_COMPARE_CAST_IMPLICIT operator std::partial_ordering() const noexcept - { - static_assert(sizeof(*this) == sizeof(std::partial_ordering)); -#ifdef __cpp_lib_bit_cast - return std::bit_cast<std::partial_ordering>(*this); -#else - using O = QtPrivate::Ordering; - using R = std::partial_ordering; - switch (m_order) { - case qToUnderlying(O::Less): return R::less; - case qToUnderlying(O::Greater): return R::greater; - case qToUnderlying(O::Equivalent): return R::equivalent; - } - Q_UNREACHABLE_RETURN(R::unordered); -#endif // __cpp_lib_bit_cast - } - friend constexpr bool operator==(weak_ordering lhs, std::weak_ordering rhs) noexcept { return static_cast<std::weak_ordering>(lhs) == rhs; } @@ -590,40 +567,6 @@ public: #endif // __cpp_lib_bit_cast } - constexpr Q_COMPARE_CAST_IMPLICIT operator std::weak_ordering() const noexcept - { - static_assert(sizeof(*this) == sizeof(std::weak_ordering)); -#ifdef __cpp_lib_bit_cast - return std::bit_cast<std::weak_ordering>(*this); -#else - using O = QtPrivate::Ordering; - using R = std::weak_ordering; - switch (m_order) { - case qToUnderlying(O::Less): return R::less; - case qToUnderlying(O::Greater): return R::greater; - case qToUnderlying(O::Equal): return R::equivalent; - } - Q_UNREACHABLE_RETURN(R::equivalent); -#endif // __cpp_lib_bit_cast - } - - constexpr Q_COMPARE_CAST_IMPLICIT operator std::partial_ordering() const noexcept - { - static_assert(sizeof(*this) == sizeof(std::partial_ordering)); -#ifdef __cpp_lib_bit_cast - return std::bit_cast<std::partial_ordering>(*this); -#else - using O = QtPrivate::Ordering; - using R = std::partial_ordering; - switch (m_order) { - case qToUnderlying(O::Less): return R::less; - case qToUnderlying(O::Greater): return R::greater; - case qToUnderlying(O::Equal): return R::equivalent; - } - Q_UNREACHABLE_RETURN(R::unordered); -#endif // __cpp_lib_bit_cast - } - friend constexpr bool operator==(strong_ordering lhs, std::strong_ordering rhs) noexcept { return static_cast<std::strong_ordering>(lhs) == rhs; } @@ -979,8 +922,6 @@ inline constexpr QPartialOrdering QPartialOrdering::equivalent(QtPrivate::Orderi inline constexpr QPartialOrdering QPartialOrdering::greater(QtPrivate::Ordering::Greater); inline constexpr QPartialOrdering QPartialOrdering::unordered(QtPrivate::LegacyUncomparable::Unordered); -#undef Q_COMPARE_CAST_IMPLICIT - QT_END_NAMESPACE #endif // QCOMPARE_H |
