refactor: 💥 ! derived_unit renamed to derived_deduced_unit

This commit is contained in:
Mateusz Pusz committed 2022-05-11 11:23:18 +02:00
1 parent 8d0b643bb3
commit f5d21a0711
16 files changed
+67 -65

No files matched your search

@@ -33,7 +33,7 @@ inline constexpr bool same_scaled_units = false;
template<typename... Es, Unit... Us>
inline constexpr bool same_scaled_units<exponent_list<Es...>, Us...> = (UnitOf<Us, typename Es::dimension> && ...);
// derived_unit
// derived_deduced_unit
template<Exponent E>
constexpr ratio inverse_if_negative(const ratio& r)
@@ -52,6 +52,7 @@ constexpr ratio derived_ratio(exponent_list<Es...>)
}
template<DerivedDimension D, Unit... Us>
using derived_unit = scaled_unit<derived_ratio<Us...>(typename D::recipe()), typename D::coherent_unit::reference>;
using derived_deduced_unit =
scaled_unit<derived_ratio<Us...>(typename D::recipe()), typename D::coherent_unit::reference>;
} // namespace units::detail
+2 -2
View File
@@ -26,7 +26,7 @@
#include <units/bits/external/downcasting.h>
// IWYU pragma: begin_exports
#include <units/bits/derived_unit.h>
#include <units/bits/derived_deduced_unit.h>
#include <units/bits/external/fixed_string.h>
#include <units/prefix.h>
#include <units/ratio.h>
@@ -155,7 +155,7 @@ struct prefixed_unit : downcast_dispatch<Child, scaled_unit<P::ratio * U::ratio,
template<typename Child, DerivedDimension Dim, Unit U, Unit... URest>
requires detail::same_scaled_units<typename Dim::recipe, U, URest...> &&
(U::is_named && (URest::is_named && ... && true))
struct derived_unit : downcast_dispatch<Child, detail::derived_unit<Dim, U, URest...>> {
struct derived_deduced_unit : downcast_dispatch<Child, detail::derived_deduced_unit<Dim, U, URest...>> {
static constexpr bool is_named = false;
static constexpr auto symbol = detail::derived_symbol_text<Dim, U, URest...>();
using prefix_family = no_prefix;