diff --git a/src/corelib/global/qcompare.h b/src/corelib/global/qcompare.h index fb5a40f0529..410605455b8 100644 --- a/src/corelib/global/qcompare.h +++ b/src/corelib/global/qcompare.h @@ -183,6 +183,30 @@ public: friend constexpr bool operator!=(std::partial_ordering lhs, partial_ordering rhs) noexcept { return lhs != static_cast(rhs); } + + friend constexpr bool operator==(partial_ordering lhs, std::strong_ordering rhs) noexcept + { return static_cast(lhs) == rhs; } + + friend constexpr bool operator!=(partial_ordering lhs, std::strong_ordering rhs) noexcept + { return static_cast(lhs) != rhs; } + + friend constexpr bool operator==(std::strong_ordering lhs, partial_ordering rhs) noexcept + { return lhs == static_cast(rhs); } + + friend constexpr bool operator!=(std::strong_ordering lhs, partial_ordering rhs) noexcept + { return lhs != static_cast(rhs); } + + friend constexpr bool operator==(partial_ordering lhs, std::weak_ordering rhs) noexcept + { return static_cast(lhs) == rhs; } + + friend constexpr bool operator!=(partial_ordering lhs, std::weak_ordering rhs) noexcept + { return static_cast(lhs) != rhs; } + + friend constexpr bool operator==(std::weak_ordering lhs, partial_ordering rhs) noexcept + { return lhs == static_cast(rhs); } + + friend constexpr bool operator!=(std::weak_ordering lhs, partial_ordering rhs) noexcept + { return lhs != static_cast(rhs); } #endif // __cpp_lib_three_way_comparison private: