From 7fe2f523d76d8d4c1a9546ea5d545b57b3a4a148 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 28 Apr 2024 16:00:25 -0400 Subject: [PATCH] xo-unit: + Quantity.abbrev() --- include/xo/unit/Quantity.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/xo/unit/Quantity.hpp b/include/xo/unit/Quantity.hpp index 97e1bb69..2ca43ecb 100644 --- a/include/xo/unit/Quantity.hpp +++ b/include/xo/unit/Quantity.hpp @@ -214,12 +214,14 @@ namespace xo { return *this; } + constexpr nu_abbrev_type abbrev() const { return unit_.abbrev(); } + private: /** @brief quantity represents this multiple of a unit amount **/ Repr scale_ = Repr{}; /** @brief unit for this quantity **/ natural_unit unit_; - }; /*Quantity2*/ + }; /*Quantity*/ /** note: won't have constexpr result until c++26 (when ::sqrt(), ::pow() are constexpr) **/