From 0f1338921d54ebbe704ae287409e3e1f88290957 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 24 Apr 2024 11:33:19 -0400 Subject: [PATCH] xo-unit: + Quantity/Dimensionless --- include/xo/unit/Quantity.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/xo/unit/Quantity.hpp b/include/xo/unit/Quantity.hpp index d24f2589..604664b2 100644 --- a/include/xo/unit/Quantity.hpp +++ b/include/xo/unit/Quantity.hpp @@ -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 + requires quantity2_concept && std::is_arithmetic_v + 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