From e538e61172450a1fc13e4aa57b554f907186c33c Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 24 Apr 2024 11:31:46 -0400 Subject: [PATCH] xo-unit: + Quantity.divide_by() --- include/xo/unit/Quantity.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/xo/unit/Quantity.hpp b/include/xo/unit/Quantity.hpp index a401fc9f..fbfe7471 100644 --- a/include/xo/unit/Quantity.hpp +++ b/include/xo/unit/Quantity.hpp @@ -66,6 +66,12 @@ namespace xo { return Quantity(x * this->scale_, this->unit_); } + template + requires std::is_arithmetic_v + constexpr auto divide_by(Dimensionless x) const { + return Quantity(this->scale_ / x, this->unit_); + } + template static constexpr auto multiply(const Quantity & x, const Quantity2 & y) {