From 914d24a90319b4b08b34c93c24f5050aa6aff531 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Fri, 21 Oct 2022 23:13:10 +0200 Subject: [PATCH] refactor: not empty constraints added for defining a symbol --- src/core/include/units/unit.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/include/units/unit.h b/src/core/include/units/unit.h index 5eff0503..f537daac 100644 --- a/src/core/include/units/unit.h +++ b/src/core/include/units/unit.h @@ -116,6 +116,7 @@ struct named_unit; * @tparam Symbol a short text representation of the unit */ template + requires(!Symbol.empty()) struct named_unit { static constexpr auto symbol = Symbol; ///< Unique base unit identifier }; @@ -129,6 +130,7 @@ struct named_unit { * @tparam Unit a unit for which we provide a special name */ template + requires(!Symbol.empty()) struct named_unit : std::remove_const_t { static constexpr auto symbol = Symbol; ///< Unique unit identifier }; @@ -196,6 +198,7 @@ concept PrefixableUnit = NamedUnit && unit_can_be_prefixed; * @tparam U a named unit to be prefixed */ template + requires(!Symbol.empty()) struct prefixed_unit : std::remove_const_t { static constexpr auto symbol = Symbol + U.symbol; };