mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-06 13:44:27 +02:00
refactor: detail::same_scaled_units
renamed to detail::compatible_units
This commit is contained in:
@@ -26,12 +26,12 @@
|
|||||||
|
|
||||||
namespace units::detail {
|
namespace units::detail {
|
||||||
|
|
||||||
// same_scaled_units
|
// compatible_units
|
||||||
template<typename ExpList, Unit... Us>
|
template<typename ExpList, Unit... Us>
|
||||||
inline constexpr bool same_scaled_units = false;
|
inline constexpr bool compatible_units = false;
|
||||||
|
|
||||||
template<typename... Es, Unit... Us>
|
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
|
// derived_scaled_unit
|
||||||
|
|
||||||
|
@@ -145,7 +145,7 @@ struct derived_unit : downcast_dispatch<Child, scaled_unit<ratio(1), Child>> {};
|
|||||||
* @tparam URest the units for the rest of dimensions from the recipe
|
* @tparam URest the units for the rest of dimensions from the recipe
|
||||||
*/
|
*/
|
||||||
template<typename Child, DerivedDimension Dim, NamedUnit U, NamedUnit... URest>
|
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...>> {
|
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...>();
|
static constexpr auto symbol = detail::derived_symbol_text<Dim, U, URest...>();
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user