From 03717ea7e92b73d6476a8d2c33e643230ea81ce4 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 17 Apr 2024 20:53:54 -0400 Subject: [PATCH] xo-unit: fix ratio_floor() + check args to Quantity converter --- include/xo/unit/quantity.hpp | 1 + include/xo/unit/ratio_util.hpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/xo/unit/quantity.hpp b/include/xo/unit/quantity.hpp index 0df8ec74..588c45ec 100644 --- a/include/xo/unit/quantity.hpp +++ b/include/xo/unit/quantity.hpp @@ -502,6 +502,7 @@ namespace xo { * @pre @c Quantity2 must have the same dimension as @c *this. **/ template + requires quantity_concept && same_dimension_v constexpr operator Quantity2 () const { /* avoid truncating precision when converting: * use best available representation diff --git a/include/xo/unit/ratio_util.hpp b/include/xo/unit/ratio_util.hpp index 1d7e3199..970068d8 100644 --- a/include/xo/unit/ratio_util.hpp +++ b/include/xo/unit/ratio_util.hpp @@ -13,7 +13,7 @@ namespace xo { template struct ratio_floor { - using type = std::ratio; + using type = std::ratio; }; template