228 constexpr bool isQOrderingType = std::is_same_v<OrderingType, Qt::partial_ordering>
229 || std::is_same_v<OrderingType, Qt::weak_ordering>
230 || std::is_same_v<OrderingType, Qt::strong_ordering>;
231#ifdef __cpp_lib_three_way_comparison
232 constexpr bool isStdOrderingType = std::is_same_v<OrderingType, std::partial_ordering>
233 || std::is_same_v<OrderingType, std::weak_ordering>
234 || std::is_same_v<OrderingType, std::strong_ordering>;
236 constexpr bool isStdOrderingType =
false;
239 static_assert(isQOrderingType || isStdOrderingType,
240 "Please provide, as the expectedOrdering parameter, a value "
241 "of one of the Qt::{partial,weak,strong}_ordering or "
242 "std::{partial,weak,strong}_ordering types.");
251 !expectedUnordered && expectedEqual);
253 expectedUnordered || !expectedEqual);
255 !expectedUnordered && expectedLess);
257 !expectedUnordered && !expectedLess && !expectedEqual);
259 !expectedUnordered && (expectedEqual || expectedLess));
261 !expectedUnordered && !expectedLess);
262#ifdef __cpp_lib_three_way_comparison
263 if constexpr (implementsThreeWayComparisonOp_v<LeftType, RightType>) {
264 if constexpr (std::is_convertible_v<OrderingType, std::strong_ordering>)
265 static_assert(std::is_same_v<
decltype(lhs <=> rhs), std::strong_ordering>);
266 else if constexpr (std::is_convertible_v<OrderingType, std::weak_ordering>)
267 static_assert(std::is_same_v<
decltype(lhs <=> rhs), std::weak_ordering>);
269 static_assert(std::is_same_v<
decltype(lhs <=> rhs), std::partial_ordering>);
272 !expectedUnordered && expectedEqual);
274 expectedUnordered || !expectedEqual);
276 !expectedUnordered && expectedLess);
278 !expectedUnordered && !expectedLess && !expectedEqual);
280 !expectedUnordered && (expectedEqual || expectedLess));
282 !expectedUnordered && !expectedLess);
287 !expectedUnordered && expectedEqual);
289 expectedUnordered || !expectedEqual);
291 !expectedUnordered && !expectedLess && !expectedEqual);
293 !expectedUnordered && expectedLess);
295 !expectedUnordered && !expectedLess);
297 !expectedUnordered && (expectedEqual || expectedLess));
298#ifdef __cpp_lib_three_way_comparison
299 if constexpr (implementsThreeWayComparisonOp_v<LeftType, RightType>) {
300 if constexpr (std::is_convertible_v<OrderingType, std::strong_ordering>)
301 static_assert(std::is_same_v<
decltype(rhs <=> lhs), std::strong_ordering>);
302 else if constexpr (std::is_convertible_v<OrderingType, std::weak_ordering>)
303 static_assert(std::is_same_v<
decltype(rhs <=> lhs), std::weak_ordering>);
305 static_assert(std::is_same_v<
decltype(rhs <=> lhs), std::partial_ordering>);
308 !expectedUnordered && expectedEqual);
310 expectedUnordered || !expectedEqual);
312 !expectedUnordered && !expectedLess && !expectedEqual);
314 !expectedUnordered && expectedLess);
316 !expectedUnordered && !expectedLess);
318 !expectedUnordered && (expectedEqual || expectedLess));