mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-02 11:54:27 +02:00
fix: perfect forwarding of a number in the reference multiply operator fixed
This commit is contained in:
@@ -158,10 +158,11 @@ template<AssociatedUnit U1, auto Q2, auto U2>
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
template<Reference R, RepresentationOf<get_quantity_spec(R{}).character> Rep>
|
template<Reference R, typename Rep>
|
||||||
[[nodiscard]] constexpr quantity<R{}, Rep> operator*(Rep&& lhs, R)
|
requires RepresentationOf<std::remove_cvref_t<Rep>, get_quantity_spec(R{}).character>
|
||||||
|
[[nodiscard]] constexpr quantity<R{}, std::remove_cvref_t<Rep>> operator*(Rep&& lhs, R)
|
||||||
{
|
{
|
||||||
return quantity<R{}, Rep>(std::forward<Rep>(lhs));
|
return quantity<R{}, std::remove_cvref_t<Rep>>(std::forward<Rep>(lhs));
|
||||||
}
|
}
|
||||||
|
|
||||||
void /*Use `q * (1 * r)` rather than `q * r`.*/ operator*(Quantity auto, Reference auto) = delete;
|
void /*Use `q * (1 * r)` rather than `q * r`.*/ operator*(Quantity auto, Reference auto) = delete;
|
||||||
|
Reference in New Issue
Block a user