Skip to content

Commit e2f11cd

Browse files
committed
fix: module export added to get_canonical_unit as a workaround
Resolves #706
1 parent d00108b commit e2f11cd

File tree

1 file changed

+6
-3
lines changed
  • src/core/include/mp-units/framework

1 file changed

+6
-3
lines changed

src/core/include/mp-units/framework/unit.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,12 @@ constexpr auto get_canonical_unit_result = get_canonical_unit_impl(U{}, U{});
120120

121121
} // namespace detail
122122

123-
// TODO this should really be in the `details` namespace but is used in `chrono.h` (a part of mp_units.systems)
124-
// Even though it is not exported, it is visible to the other module via ADL
125-
[[nodiscard]] consteval auto get_canonical_unit(Unit auto u) { return detail::get_canonical_unit_result<decltype(u)>; }
123+
// TODO this should really be in the `details` namespace and not exported but is used in `chrono.h`
124+
// (a part of mp_units.systems)
125+
MP_UNITS_EXPORT [[nodiscard]] consteval auto get_canonical_unit(Unit auto u)
126+
{
127+
return detail::get_canonical_unit_result<decltype(u)>;
128+
}
126129

127130
template<UnitMagnitude auto M, Unit U>
128131
requires(M != detail::unit_magnitude<>{} && M != mag<1>)

0 commit comments

Comments
 (0)