From e0ce43c5efe9a9a5587a7d48878646b9131ff3a4 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Thu, 3 Apr 2025 16:05:31 +0100 Subject: [PATCH] feat: `IsFloatingPoint` removed and replaced with `treat_as_floating_point` --- src/core/include/mp-units/framework/quantity.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/core/include/mp-units/framework/quantity.h b/src/core/include/mp-units/framework/quantity.h index 4b64a707..3ad8f563 100644 --- a/src/core/include/mp-units/framework/quantity.h +++ b/src/core/include/mp-units/framework/quantity.h @@ -61,15 +61,13 @@ template return is_integral(get_canonical_unit(from).mag / get_canonical_unit(to).mag); } -template -concept IsFloatingPoint = treat_as_floating_point; - template -concept ValuePreservingTo = Unit && - Unit && std::assignable_from && - (IsFloatingPoint || (!IsFloatingPoint> && - integral_conversion_factor(FromUnit, ToUnit) && - !overflows_non_zero_values(FromUnit, ToUnit))); +concept ValuePreservingTo = + Unit && Unit && + std::assignable_from && + (treat_as_floating_point || + (!treat_as_floating_point> && integral_conversion_factor(FromUnit, ToUnit) && + !overflows_non_zero_values(FromUnit, ToUnit))); template concept RepresentationValuePreservingTo =