@@ -120,25 +120,23 @@ struct get_canonical_unit_result {
120
120
inline static constexpr auto value = get_canonical_unit_impl(U{}, U{});
121
121
};
122
122
123
- template <Unit Lhs, Unit Rhs>
124
- struct unit_less : std::bool_constant<type_name<Lhs>() < type_name<Rhs>()> {};
123
+ } // namespace detail
125
124
126
- template <typename T1, typename T2>
127
- using type_list_of_unit_less = expr_less<T1, T2, unit_less>;
125
+ // TODO this should really be in the `details` namespace but is used in `chrono.h` (a part of mp_units.systems)
126
+ // Even though it is not exported, it is visible to the other module via ADL
127
+ [[nodiscard]] consteval auto get_canonical_unit (Unit auto u)
128
+ {
129
+ return detail::get_canonical_unit_result<decltype (u)>::value;
130
+ }
131
+
132
+ namespace detail {
128
133
129
134
template <typename From, typename To>
130
135
concept PotentiallyConvertibleTo = Unit<From> && Unit<To> &&
131
136
((AssociatedUnit<From> && AssociatedUnit<To> &&
132
137
implicitly_convertible (get_quantity_spec(From{}), get_quantity_spec(To{}))) ||
133
138
(!AssociatedUnit<From> && !AssociatedUnit<To>));
134
139
135
- } // namespace detail
136
-
137
- // TODO this should really be in the `details` namespace but is used in `chrono.h` (a part of mp_units.systems)
138
- // Even though it is not exported, it is visible to the other module via ADL
139
- [[nodiscard]] consteval auto get_canonical_unit (Unit auto u)
140
- {
141
- return detail::get_canonical_unit_result<decltype (u)>::value;
142
140
}
143
141
144
142
// convertible
@@ -159,6 +157,12 @@ struct derived_unit;
159
157
160
158
namespace detail {
161
159
160
+ template <Unit Lhs, Unit Rhs>
161
+ struct unit_less : std::bool_constant<type_name<Lhs>() < type_name<Rhs>()> {};
162
+
163
+ template <typename T1, typename T2>
164
+ using type_list_of_unit_less = expr_less<T1, T2, unit_less>;
165
+
162
166
struct unit_interface {
163
167
/* *
164
168
* Multiplication by `1` returns the same unit, otherwise `scaled_unit` is being returned.
0 commit comments