xo-unit: + Quantity/Dimensionless

This commit is contained in:
Roland Conybeare 2024-04-24 11:33:19 -04:00
commit 0f1338921d

View file

@ -242,6 +242,16 @@ namespace xo {
return Quantity::divide(x, y);
}
/** note: won't have constexpr result until c++26 (when ::sqrt(), ::pow() are constexpr)
**/
template <typename Quantity, typename Dimensionless>
requires quantity2_concept<Quantity> && std::is_arithmetic_v<Dimensionless>
constexpr auto
operator/ (const Quantity & x, Dimensionless y)
{
return x.divide_by(y);
}
/** note: won't have constexpr result until c++26 (when ::sqrt(), ::pow() are constexpr)
**/
template <typename Quantity, typename Quantity2>