From 613bbca6207fc20ff26eb35b2fa0172568e5a7e4 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 1 Aug 2023 11:57:20 +0200 Subject: [PATCH] fix: `quantity_point` now uses `absolute()` instead of `relative()` for comparisons --- src/core/include/mp-units/quantity_point.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/include/mp-units/quantity_point.h b/src/core/include/mp-units/quantity_point.h index 8edb6638..6d99eaae 100644 --- a/src/core/include/mp-units/quantity_point.h +++ b/src/core/include/mp-units/quantity_point.h @@ -258,14 +258,14 @@ template QP2> requires std::three_way_comparable_with [[nodiscard]] constexpr auto operator<=>(const QP1& lhs, const QP2& rhs) { - return lhs.relative() <=> rhs.relative(); + return lhs.absolute() <=> rhs.absolute(); } template QP2> requires std::equality_comparable_with [[nodiscard]] constexpr bool operator==(const QP1& lhs, const QP2& rhs) { - return lhs.relative() == rhs.relative(); + return lhs.absolute() == rhs.absolute(); } } // namespace mp_units