From e2f11cd3f95dca0c24a74c318680dfb32256601d Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Wed, 11 Jun 2025 18:15:32 +0200 Subject: [PATCH] fix: module export added to `get_canonical_unit` as a workaround Resolves #706 --- src/core/include/mp-units/framework/unit.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/include/mp-units/framework/unit.h b/src/core/include/mp-units/framework/unit.h index ae0aae78..0eec635b 100644 --- a/src/core/include/mp-units/framework/unit.h +++ b/src/core/include/mp-units/framework/unit.h @@ -120,9 +120,12 @@ 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; } +// TODO this should really be in the `details` namespace and not exported but is used in `chrono.h` +// (a part of mp_units.systems) +MP_UNITS_EXPORT [[nodiscard]] consteval auto get_canonical_unit(Unit auto u) +{ + return detail::get_canonical_unit_result; +} template requires(M != detail::unit_magnitude<>{} && M != mag<1>)