mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 12:24:26 +02:00
refactor: order of overload for Unit
changed
This commit is contained in:
@@ -394,6 +394,15 @@ template<Magnitude M, Unit U>
|
||||
|
||||
[[nodiscard]] consteval Unit auto operator*(Unit auto, Magnitude auto) = delete;
|
||||
|
||||
/**
|
||||
* Returns the result of multiplication with an inverse unit.
|
||||
*/
|
||||
template<Magnitude M, Unit U>
|
||||
[[nodiscard]] MP_UNITS_CONSTEVAL Unit auto operator/(M mag, const U u)
|
||||
{
|
||||
return mag * inverse(u);
|
||||
}
|
||||
|
||||
/**
|
||||
* `scaled_unit` specializations have priority in this operation. This means that the library framework
|
||||
* prevents passing it as an element to the `derived_unit`. In such case only the reference unit is passed
|
||||
@@ -412,15 +421,6 @@ template<Unit Lhs, Unit Rhs>
|
||||
return detail::expr_multiply<derived_unit, struct one, detail::type_list_of_unit_less>(lhs, rhs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of multiplication with an inverse unit.
|
||||
*/
|
||||
template<Magnitude M, Unit U>
|
||||
[[nodiscard]] MP_UNITS_CONSTEVAL Unit auto operator/(M mag, const U u)
|
||||
{
|
||||
return mag * inverse(u);
|
||||
}
|
||||
|
||||
/**
|
||||
* `scaled_unit` specializations have priority in this operation. This means that the library framework
|
||||
* prevents passing it as an element to the `derived_unit`. In such case only the reference unit is passed
|
||||
|
Reference in New Issue
Block a user