refactor: order of overload for Unit changed

This commit is contained in:
Mateusz Pusz
2023-10-17 12:11:32 +02:00
parent 98d07b9ed1
commit 6e7a2fd0bb

View File

@@ -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