From 32c3d8e44e376ba1a8950b0ad5378afaceda52c2 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 10 Jun 2024 12:03:22 -0400 Subject: [PATCH] xo-unit: + currency() named-ctor --- include/xo/unit/quantity.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/xo/unit/quantity.hpp b/include/xo/unit/quantity.hpp index 5d549b9c..e986b95f 100644 --- a/include/xo/unit/quantity.hpp +++ b/include/xo/unit/quantity.hpp @@ -974,6 +974,14 @@ namespace xo { } /*namespace qty*/ + namespace qty { + // ----- currency ----- + + /** create quantity representing @p x units of currency, with compile-time unit representation **/ + template + inline constexpr auto currency(Repr x) { return quantity(x); } + } + namespace qty { // ----- volatility -----