Skip to content

Commit

Permalink
refactor: quantity_cast implementation now use make_reference()
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Dec 26, 2023
1 parent 78872e1 commit 1db975d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/core/include/mp-units/bits/quantity_cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ template<QuantitySpec auto ToQS, typename Q>
requires Quantity<std::remove_cvref_t<Q>> && (castable(Q::quantity_spec, ToQS))
[[nodiscard]] constexpr Quantity auto quantity_cast(Q&& q)
{
if constexpr (detail::QuantityKindSpec<std::remove_const_t<decltype(ToQS)>> &&
AssociatedUnit<std::remove_const_t<decltype(Q::unit)>>)
return quantity{std::forward<Q>(q).numerical_value_is_an_implementation_detail_, Q::unit};
else
return quantity{std::forward<Q>(q).numerical_value_is_an_implementation_detail_, reference<ToQS, Q::unit>{}};
return quantity{std::forward<Q>(q).numerical_value_is_an_implementation_detail_, make_reference(ToQS, Q::unit)};
}

/**
Expand Down

0 comments on commit 1db975d

Please sign in to comment.