From 1db975d48c0e4dd523f4c7e3a677d3ff779c2f18 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 26 Dec 2023 10:33:04 +0100 Subject: [PATCH] refactor: `quantity_cast` implementation now use `make_reference()` --- src/core/include/mp-units/bits/quantity_cast.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/core/include/mp-units/bits/quantity_cast.h b/src/core/include/mp-units/bits/quantity_cast.h index cf8fbef9e..04228a3b8 100644 --- a/src/core/include/mp-units/bits/quantity_cast.h +++ b/src/core/include/mp-units/bits/quantity_cast.h @@ -50,11 +50,7 @@ template requires Quantity> && (castable(Q::quantity_spec, ToQS)) [[nodiscard]] constexpr Quantity auto quantity_cast(Q&& q) { - if constexpr (detail::QuantityKindSpec> && - AssociatedUnit>) - return quantity{std::forward(q).numerical_value_is_an_implementation_detail_, Q::unit}; - else - return quantity{std::forward(q).numerical_value_is_an_implementation_detail_, reference{}}; + return quantity{std::forward(q).numerical_value_is_an_implementation_detail_, make_reference(ToQS, Q::unit)}; } /**