Skip to content

Commit

Permalink
Unify the names of private comparison helper macros
Browse files Browse the repository at this point in the history
... 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 <[email protected]>
Reviewed-by: Thiago Macieira <[email protected]>
  • Loading branch information
isolovev committed Oct 15, 2024
1 parent aef9fff commit 6a8ecde
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/corelib/global/qcomparehelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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

Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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

Expand Down

0 comments on commit 6a8ecde

Please sign in to comment.