From c46a66565c23784414ba47a57b0f923ee08ec52d Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 24 Apr 2024 11:32:01 -0400 Subject: [PATCH] xo-unit: + Quantity.divide_into() --- 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 fbfe7471..3dd82eaf 100644 --- a/include/xo/unit/Quantity.hpp +++ b/include/xo/unit/Quantity.hpp @@ -72,6 +72,12 @@ namespace xo { return Quantity(this->scale_ / x, this->unit_); } + template + requires std::is_arithmetic_v + constexpr auto divide_into(Dimensionless x) const { + return Quantity(x / this->scale_, this->unit_.reciprocal()); + } + template static constexpr auto multiply(const Quantity & x, const Quantity2 & y) {