diff --git a/src/core/include/mp-units/framework/quantity_spec.h b/src/core/include/mp-units/framework/quantity_spec.h index 835ae2c9..7d99f053 100644 --- a/src/core/include/mp-units/framework/quantity_spec.h +++ b/src/core/include/mp-units/framework/quantity_spec.h @@ -1476,7 +1476,7 @@ template } template -[[nodiscard]] consteval QuantitySpec auto get_kind_tree_root(Q q) +[[nodiscard]] consteval QuantitySpec auto get_kind_tree_root_impl(Q q) { auto defined_as_kind = [](QQ qq) { if constexpr (requires { defined_as_kind_impl(qq); }) @@ -1501,6 +1501,15 @@ template // NOLINTEND(bugprone-branch-clone) } +template +constexpr QuantitySpec auto get_kind_tree_root_result = get_kind_tree_root_impl(Q{}); + +template +[[nodiscard]] consteval QuantitySpec auto get_kind_tree_root(Q) +{ + return get_kind_tree_root_result; +} + } // namespace detail MP_UNITS_EXPORT_BEGIN