diff --git a/src/core/include/mp-units/framework/unit.h b/src/core/include/mp-units/framework/unit.h index 2be5cdb8..9cdbe173 100644 --- a/src/core/include/mp-units/framework/unit.h +++ b/src/core/include/mp-units/framework/unit.h @@ -120,18 +120,6 @@ struct get_canonical_unit_result { inline static constexpr auto value = get_canonical_unit_impl(U{}, U{}); }; -template -struct unit_less : std::bool_constant() < type_name()> {}; - -template -using type_list_of_unit_less = expr_less; - -template -concept PotentiallyConvertibleTo = Unit && Unit && - ((AssociatedUnit && AssociatedUnit && - implicitly_convertible(get_quantity_spec(From{}), get_quantity_spec(To{}))) || - (!AssociatedUnit && !AssociatedUnit)); - } // namespace detail // TODO this should really be in the `details` namespace but is used in `chrono.h` (a part of mp_units.systems) @@ -141,6 +129,16 @@ concept PotentiallyConvertibleTo = Unit && Unit && return detail::get_canonical_unit_result::value; } +namespace detail { + +template +concept PotentiallyConvertibleTo = Unit && Unit && + ((AssociatedUnit && AssociatedUnit && + implicitly_convertible(get_quantity_spec(From{}), get_quantity_spec(To{}))) || + (!AssociatedUnit && !AssociatedUnit)); + +} + // convertible template [[nodiscard]] consteval bool convertible(From from, To to) @@ -159,6 +157,12 @@ struct derived_unit; namespace detail { +template +struct unit_less : std::bool_constant() < type_name()> {}; + +template +using type_list_of_unit_less = expr_less; + struct unit_interface { /** * Multiplication by `1` returns the same unit, otherwise `scaled_unit` is being returned.