From 6a8ecdea9019ce3982aa40a122b38ed2e11ad370 Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Thu, 19 Sep 2024 13:58:22 +0200 Subject: [PATCH] Unify the names of private comparison helper macros ... between C++17 and C++20 implementations. This will allow us to use these macros in the container comparison implementation. Task-number: QTBUG-127095 Task-number: QTBUG-120305 Change-Id: Id3f38c44c9fa32322ee831c5300c0d3a998325f7 Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira --- src/corelib/global/qcomparehelpers.h | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/corelib/global/qcomparehelpers.h b/src/corelib/global/qcomparehelpers.h index 3c5d1e0ef22..779a0e3a79d 100644 --- a/src/corelib/global/qcomparehelpers.h +++ b/src/corelib/global/qcomparehelpers.h @@ -181,7 +181,7 @@ orderingFlagsFor(T t) noexcept return comparesEqual(lhs, rhs); \ } -#define QT_DECLARE_3WAY_HELPER_STRONG(LeftType, RightType, Constexpr, Noexcept, ...) \ +#define QT_DECLARE_ORDERING_HELPER_STRONG(LeftType, RightType, Constexpr, Noexcept, ...) \ __VA_ARGS__ \ friend Constexpr std::strong_ordering \ operator<=>(LeftType const &lhs, RightType const &rhs) Noexcept \ @@ -190,7 +190,7 @@ orderingFlagsFor(T t) noexcept return compareThreeWay(lhs, rhs); \ } -#define QT_DECLARE_3WAY_HELPER_WEAK(LeftType, RightType, Constexpr, Noexcept, ...) \ +#define QT_DECLARE_ORDERING_HELPER_WEAK(LeftType, RightType, Constexpr, Noexcept, ...) \ __VA_ARGS__ \ friend Constexpr std::weak_ordering \ operator<=>(LeftType const &lhs, RightType const &rhs) Noexcept \ @@ -199,7 +199,7 @@ orderingFlagsFor(T t) noexcept return compareThreeWay(lhs, rhs); \ } -#define QT_DECLARE_3WAY_HELPER_PARTIAL(LeftType, RightType, Constexpr, Noexcept, ...) \ +#define QT_DECLARE_ORDERING_HELPER_PARTIAL(LeftType, RightType, Constexpr, Noexcept, ...) \ __VA_ARGS__ \ friend Constexpr std::partial_ordering \ operator<=>(LeftType const &lhs, RightType const &rhs) Noexcept \ @@ -208,7 +208,7 @@ orderingFlagsFor(T t) noexcept return compareThreeWay(lhs, rhs); \ } -#define QT_DECLARE_3WAY_HELPER_AUTO(LeftType, RightType, Constexpr, Noexcept, ...) \ +#define QT_DECLARE_ORDERING_HELPER_AUTO(LeftType, RightType, Constexpr, Noexcept, ...) \ __VA_ARGS__ \ friend Constexpr auto \ operator<=>(LeftType const &lhs, RightType const &rhs) Noexcept \ @@ -220,8 +220,8 @@ orderingFlagsFor(T t) noexcept #define QT_DECLARE_ORDERING_OPERATORS_HELPER(OrderingType, LeftType, RightType, Constexpr, \ Noexcept, ...) \ QT_DECLARE_EQUALITY_OPERATORS_HELPER(LeftType, RightType, Constexpr, Noexcept, __VA_ARGS__) \ - QT_DECLARE_3WAY_HELPER_ ## OrderingType (LeftType, RightType, Constexpr, Noexcept, \ - __VA_ARGS__) + QT_DECLARE_ORDERING_HELPER_ ## OrderingType (LeftType, RightType, Constexpr, Noexcept, \ + __VA_ARGS__) #ifdef Q_COMPILER_LACKS_THREE_WAY_COMPARE_SYMMETRY @@ -232,8 +232,8 @@ orderingFlagsFor(T t) noexcept friend Constexpr bool operator==(RightType const &lhs, LeftType const &rhs) Noexcept \ { return comparesEqual(rhs, lhs); } -#define QT_DECLARE_REVERSED_3WAY_HELPER_STRONG(LeftType, RightType, Constexpr, \ - Noexcept, ...) \ +#define QT_DECLARE_REVERSED_ORDERING_HELPER_STRONG(LeftType, RightType, Constexpr, \ + Noexcept, ...) \ __VA_ARGS__ \ friend Constexpr std::strong_ordering \ operator<=>(RightType const &lhs, LeftType const &rhs) Noexcept \ @@ -242,8 +242,8 @@ orderingFlagsFor(T t) noexcept return QtOrderingPrivate::reversed(r); \ } -#define QT_DECLARE_REVERSED_3WAY_HELPER_WEAK(LeftType, RightType, Constexpr, \ - Noexcept, ...) \ +#define QT_DECLARE_REVERSED_ORDERING_HELPER_WEAK(LeftType, RightType, Constexpr, \ + Noexcept, ...) \ __VA_ARGS__ \ friend Constexpr std::weak_ordering \ operator<=>(RightType const &lhs, LeftType const &rhs) Noexcept \ @@ -252,8 +252,8 @@ orderingFlagsFor(T t) noexcept return QtOrderingPrivate::reversed(r); \ } -#define QT_DECLARE_REVERSED_3WAY_HELPER_PARTIAL(LeftType, RightType, Constexpr, \ - Noexcept, ...) \ +#define QT_DECLARE_REVERSED_ORDERING_HELPER_PARTIAL(LeftType, RightType, Constexpr, \ + Noexcept, ...) \ __VA_ARGS__ \ friend Constexpr std::partial_ordering \ operator<=>(RightType const &lhs, LeftType const &rhs) Noexcept \ @@ -262,7 +262,7 @@ orderingFlagsFor(T t) noexcept return QtOrderingPrivate::reversed(r); \ } -#define QT_DECLARE_REVERSED_3WAY_HELPER_AUTO(LeftType, RightType, Constexpr, Noexcept, ...) \ +#define QT_DECLARE_REVERSED_ORDERING_HELPER_AUTO(LeftType, RightType, Constexpr, Noexcept, ...) \ __VA_ARGS__ \ friend Constexpr auto \ operator<=>(RightType const &lhs, LeftType const &rhs) Noexcept \ @@ -275,8 +275,8 @@ orderingFlagsFor(T t) noexcept Constexpr, Noexcept, ...) \ QT_DECLARE_EQUALITY_OPERATORS_REVERSED_HELPER(LeftType, RightType, Constexpr, \ Noexcept, __VA_ARGS__) \ - QT_DECLARE_REVERSED_3WAY_HELPER_ ## OrderingString (LeftType, RightType, Constexpr, \ - Noexcept, __VA_ARGS__) + QT_DECLARE_REVERSED_ORDERING_HELPER_ ## OrderingString (LeftType, RightType, Constexpr, \ + Noexcept, __VA_ARGS__) #else