diff --git a/src/corelib/global/qcomparehelpers.h b/src/corelib/global/qcomparehelpers.h index ad21d461b9f..d7e007b8b0a 100644 --- a/src/corelib/global/qcomparehelpers.h +++ b/src/corelib/global/qcomparehelpers.h @@ -353,23 +353,11 @@ constexpr bool IsFloatType_v = true; namespace Qt { -template -using if_integral = - std::enable_if_t> - && QtPrivate::IsIntegralType_v>, - bool>; +template +using if_integral = std::enable_if_t, bool>; -template -using if_floating_point = - std::enable_if_t> - && QtPrivate::IsFloatType_v>, - bool>; - -template -using if_integral_and_floating_point = - std::enable_if_t> - && QtPrivate::IsFloatType_v>, - bool>; +template +using if_floating_point = std::enable_if_t, bool>; template using if_compatible_pointers = @@ -382,7 +370,8 @@ template using if_enum = std::enable_if_t, bool>; template = true> + if_integral = true, + if_integral = true> constexpr Qt::strong_ordering compareThreeWay(LeftInt lhs, RightInt rhs) noexcept { static_assert(std::is_signed_v == std::is_signed_v, @@ -401,7 +390,8 @@ constexpr Qt::strong_ordering compareThreeWay(LeftInt lhs, RightInt rhs) noexcep } template = true> + if_floating_point = true, + if_floating_point = true> constexpr Qt::partial_ordering compareThreeWay(LeftFloat lhs, RightFloat rhs) noexcept { QT_WARNING_PUSH @@ -422,14 +412,16 @@ QT_WARNING_POP } template = true> + if_integral = true, + if_floating_point = true> constexpr Qt::partial_ordering compareThreeWay(IntType lhs, FloatType rhs) noexcept { return compareThreeWay(FloatType(lhs), rhs); } template = true> + if_floating_point = true, + if_integral = true> constexpr Qt::partial_ordering compareThreeWay(FloatType lhs, IntType rhs) noexcept { return compareThreeWay(lhs, FloatType(rhs)); diff --git a/tests/auto/corelib/global/qcomparehelpers/tst_qcomparehelpers.cpp b/tests/auto/corelib/global/qcomparehelpers/tst_qcomparehelpers.cpp index 86ca75680c9..c0911409d79 100644 --- a/tests/auto/corelib/global/qcomparehelpers/tst_qcomparehelpers.cpp +++ b/tests/auto/corelib/global/qcomparehelpers/tst_qcomparehelpers.cpp @@ -460,7 +460,8 @@ void tst_QCompareHelpers::generatedClasses() } template = true> + Qt::if_integral = true, + Qt::if_integral = true> void testOrderForTypes() { LeftType l0{0}; @@ -506,7 +507,8 @@ void testOrderForTypes() } template = true> + Qt::if_floating_point = true, + Qt::if_floating_point = true> void testOrderForTypes() { LeftType lNeg{-1.0}; @@ -575,7 +577,8 @@ void testOrderForTypes() } template = true> + Qt::if_integral = true, + Qt::if_floating_point = true> void testOrderForTypes() { IntType l0{0};