From 7e789bc1f1398ee605e27829f818bb12157c735a Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Wed, 4 Dec 2024 19:57:58 +0100 Subject: [PATCH] refactor: `std::assignable_from` used in `ValuePreservingTo` concept --- src/core/include/mp-units/framework/quantity.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/include/mp-units/framework/quantity.h b/src/core/include/mp-units/framework/quantity.h index 3d829769..697efbb3 100644 --- a/src/core/include/mp-units/framework/quantity.h +++ b/src/core/include/mp-units/framework/quantity.h @@ -63,11 +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 = Representation> && Representation && + Unit && + Unit && std::assignable_from && + (IsFloatingPoint || (!IsFloatingPoint> && + (integral_conversion_factor(FromUnit, ToUnit)))); template concept QuantityConvertibleTo =