Merge branch 'master' into chiphogg/switch-to-mag

This commit is contained in:
Chip Hogg
2022-06-15 20:50:30 +00:00
30 changed files with 391 additions and 116 deletions
@@ -27,12 +27,12 @@
namespace units::detail {
// same_scaled_units
// compatible_units
template<typename ExpList, Unit... Us>
inline constexpr bool same_scaled_units = false;
inline constexpr bool compatible_units = false;
template<typename... Es, Unit... Us>
inline constexpr bool same_scaled_units<exponent_list<Es...>, Us...> = (UnitOf<Us, typename Es::dimension> && ...);
inline constexpr bool compatible_units<exponent_list<Es...>, Us...> = (UnitOf<Us, typename Es::dimension> && ...);
// derived_scaled_unit
@@ -42,7 +42,7 @@ constexpr auto operator_text()
if constexpr (Divide && NegativeExpCount == 1) {
return basic_fixed_string("/");
} else {
return basic_symbol_text(" ⋅ ", " ");
return basic_symbol_text("⋅", " ");
}
}
}
+3
View File
@@ -449,6 +449,9 @@ template<typename D, typename U, typename Rep>
explicit(false) quantity(Rep&&)->quantity<D, U, Rep>;
#endif
template<typename D, typename U, typename Rep>
explicit(false) quantity(quantity<D, U, Rep>)->quantity<D, U, Rep>;
template<Representation Rep>
explicit(false) quantity(Rep)->quantity<dim_one, one, Rep>;
+1 -1
View File
@@ -142,7 +142,7 @@ struct derived_unit : downcast_dispatch<Child, scaled_unit<as_magnitude<1>(), Ch
* @tparam URest the units for the rest of dimensions from the recipe
*/
template<typename Child, DerivedDimension Dim, NamedUnit U, NamedUnit... URest>
requires detail::same_scaled_units<typename Dim::recipe, U, URest...>
requires detail::compatible_units<typename Dim::recipe, U, URest...>
struct derived_scaled_unit : downcast_dispatch<Child, detail::derived_scaled_unit<Dim, U, URest...>> {
static constexpr auto symbol = detail::derived_symbol_text<Dim, U, URest...>();
};