From 9d05e31af787a0f2df7e7aa59727960ea88787fa Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Sat, 2 Nov 2024 13:45:42 +0100 Subject: [PATCH] refactor: `point_origin_interface::op-` cleanup --- src/core/include/mp-units/framework/quantity_point.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/include/mp-units/framework/quantity_point.h b/src/core/include/mp-units/framework/quantity_point.h index 920abcabe..4fa468568 100644 --- a/src/core/include/mp-units/framework/quantity_point.h +++ b/src/core/include/mp-units/framework/quantity_point.h @@ -81,9 +81,9 @@ struct point_origin_interface { [[nodiscard]] friend constexpr Quantity auto operator-(PO1 po1, PO2 po2) { if constexpr (is_derived_from_specialization_of_v) { - return -(po2.quantity_point - po2.quantity_point.absolute_point_origin); + return po1 - po2.quantity_point; } else if constexpr (is_derived_from_specialization_of_v) { - return po1.quantity_point - po1.quantity_point.absolute_point_origin; + return po1.quantity_point - po2; } else { return po1.quantity_point - po2.quantity_point; }