From 2a1edbe47a56bf2e6f3fdaba5a0fcf68cb9e9d20 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Sat, 26 Oct 2024 19:11:10 +0200 Subject: [PATCH] fix: `ValuePreservingTo` fixed to apply `std::remove_cvref_t` on `FromRep` --- src/core/include/mp-units/framework/quantity.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/include/mp-units/framework/quantity.h b/src/core/include/mp-units/framework/quantity.h index 67ea73ff..3c4dc0c9 100644 --- a/src/core/include/mp-units/framework/quantity.h +++ b/src/core/include/mp-units/framework/quantity.h @@ -63,9 +63,11 @@ template concept IsFloatingPoint = treat_as_floating_point; template -concept ValuePreservingTo = requires(FromRep&& from, ToRep to) { - { to = std::forward(from) } -> std::same_as; -} && (IsFloatingPoint || (!IsFloatingPoint && (integral_conversion_factor(FromUnit, ToUnit)))); +concept ValuePreservingTo = + requires(FromRep&& from, ToRep to) { + { to = std::forward(from) } -> std::same_as; + } && (IsFloatingPoint || + (!IsFloatingPoint> && (integral_conversion_factor(FromUnit, ToUnit)))); template concept QuantityConvertibleTo =