diff --git a/src/corelib/global/qcomparehelpers.h b/src/corelib/global/qcomparehelpers.h index 8ce91229b7f..ede96a83cf6 100644 --- a/src/corelib/global/qcomparehelpers.h +++ b/src/corelib/global/qcomparehelpers.h @@ -1250,6 +1250,13 @@ constexpr bool compareThreeWayNoexcept() noexcept } } } synthThreeWay; + +template +using if_has_op_less_or_op_compare_three_way = + std::enable_if_t< + std::disjunction_v, + QTypeTraits::has_operator_compare_three_way>, + bool>; #endif // __cpp_lib_three_way_comparison // These checks do not use Qt::compareThreeWay(), so only work for user-defined diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 8ccf512389d..45ecac01574 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -349,14 +349,8 @@ private: } #if defined(__cpp_lib_three_way_comparison) && defined(__cpp_lib_concepts) - template - using if_has_op_less_or_op_compare_three_way = - std::enable_if_t< - std::disjunction_v, - QTypeTraits::has_operator_compare_three_way>, - bool>; - - template = true> + template = true> friend auto operator<=>(const QList &lhs, const QList &rhs) { return std::lexicographical_compare_three_way(lhs.begin(), lhs.end(), diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index fb3c53c49cd..cb148075e3f 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -640,15 +640,8 @@ private: } #if defined(__cpp_lib_three_way_comparison) && defined(__cpp_lib_concepts) - template - using if_has_op_less_or_op_compare_three_way = - std::enable_if_t< - std::disjunction_v, - QTypeTraits::has_operator_compare_three_way>, - bool>; - template = true> + QtOrderingPrivate::if_has_op_less_or_op_compare_three_way = true> friend auto operator<=>(const QVarLengthArray &lhs, const QVarLengthArray &rhs) {