From 176f9f6ce2bbdf5d227f44c5d057932347dd69ab Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 28 Jan 2025 16:20:52 +0100 Subject: [PATCH] Give LegacyUncomparable::Unordered's value a symbolic name We'll need it higher up in the file, but we don't want to/can't move code around, so make -127 a symbolic constant. Amends 39c7bf4631b401c681c24bb5a732a0359c8a6d7c, which, however, merely moved the code around. Pick-to: 6.8 Change-Id: Id6f2d51e5678b3bad7ae658cc3e38fd3909861d7 Reviewed-by: Ivan Solovev Reviewed-by: Thiago Macieira (cherry picked from commit 57aabff91eed41fb7ba0cf67df4fe7767c6e0e43) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/global/qcompare.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qcompare.h b/src/corelib/global/qcompare.h index c0ca4be00ea..0c450158598 100644 --- a/src/corelib/global/qcompare.h +++ b/src/corelib/global/qcompare.h @@ -23,6 +23,7 @@ QT_BEGIN_NAMESPACE namespace QtPrivate { using CompareUnderlyingType = qint8; +constexpr CompareUnderlyingType LegacyUncomparableValue = -127; // historic Qt value // [cmp.categories.pre] / 1 enum class Ordering : CompareUnderlyingType @@ -675,7 +676,7 @@ auto qCompareThreeWay(const LT &lhs, const RT &rhs) namespace QtPrivate { enum class LegacyUncomparable : CompareUnderlyingType { - Unordered = -127 + Unordered = QtPrivate::LegacyUncomparableValue }; }