From 026dbed22a49461d251b779e5cbf994f9af15b7d Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Sun, 24 Nov 2024 13:51:17 +0100 Subject: [PATCH] refactor: `get_canonical_unit_result` refactored to a variable template --- src/core/include/mp-units/framework/unit.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/core/include/mp-units/framework/unit.h b/src/core/include/mp-units/framework/unit.h index 0962f7dd..ffea5720 100644 --- a/src/core/include/mp-units/framework/unit.h +++ b/src/core/include/mp-units/framework/unit.h @@ -116,18 +116,13 @@ template [[nodiscard]] consteval auto get_canonical_unit_impl(T, const common_unit&); template -struct get_canonical_unit_result { - inline static constexpr auto value = get_canonical_unit_impl(U{}, U{}); -}; +constexpr auto get_canonical_unit_result = get_canonical_unit_impl(U{}, U{}); } // namespace detail // TODO this should really be in the `details` namespace but is used in `chrono.h` (a part of mp_units.systems) // Even though it is not exported, it is visible to the other module via ADL -[[nodiscard]] consteval auto get_canonical_unit(Unit auto u) -{ - return detail::get_canonical_unit_result::value; -} +[[nodiscard]] consteval auto get_canonical_unit(Unit auto u) { return detail::get_canonical_unit_result; } namespace detail {