refactor: 💥 got rid of a noble_derived_unit

Resolves #280
This commit is contained in:
Mateusz Pusz committed 2021-05-10 18:03:47 +02:00
1 parent 7ead50acfc
commit b894ee6558
10 files changed
+25 -40

No files matched your search

@@ -28,8 +28,14 @@
namespace units::isq {
template<typename Child, Unit U, typename...>
struct dim_energy;
template<typename Child, Unit U, DimensionOfT<dim_force> F, DimensionOfT<dim_length> L>
struct dim_energy : derived_dimension<Child, U, exponent<F, 1>, exponent<L, 1>> {};
struct dim_energy<Child, U, F, L> : derived_dimension<Child, U, exponent<F, 1>, exponent<L, 1>> {};
template<typename Child, Unit U, DimensionOfT<dim_length> L, DimensionOfT<dim_force> F>
struct dim_energy<Child, U, L, F> : derived_dimension<Child, U, exponent<L, 1>, exponent<F, 1>> {};
template<typename T>
concept Energy = QuantityOfT<T, dim_energy>;
@@ -28,8 +28,14 @@
namespace units::isq {
template<typename Child, Unit U, typename...>
struct dim_power;
template<typename Child, Unit U, DimensionOfT<dim_energy> E, DimensionOfT<dim_time> T>
struct dim_power : derived_dimension<Child, U, exponent<E, 1>, exponent<T, -1>> {};
struct dim_power<Child, U, E, T> : derived_dimension<Child, U, exponent<E, 1>, exponent<T, -1>> {};
template<typename Child, Unit U, DimensionOfT<dim_length> L, DimensionOfT<dim_force> F, DimensionOfT<dim_time> T>
struct dim_power<Child, U, L, F, T> : derived_dimension<Child, U, exponent<L, 1>, exponent<F, 1>, exponent<T, -1>> {};
template<typename T>
concept Power = QuantityOfT<T, dim_power>;
@@ -37,10 +37,10 @@ namespace units::isq::si::fps {
// https://en.wikipedia.org/wiki/Foot-poundal
struct foot_poundal : unit<foot_poundal> {};
struct dim_energy : isq::dim_energy<dim_energy, foot_poundal, dim_force, dim_length> {};
struct dim_energy : isq::dim_energy<dim_energy, foot_poundal, dim_length, dim_force> {};
// https://en.wikipedia.org/wiki/Foot-pound_(energy)
struct foot_pound_force : noble_derived_unit<foot_pound_force, dim_energy, pound_force, foot> {};
struct foot_pound_force : derived_unit<foot_pound_force, dim_energy, foot, pound_force> {};
template<UnitOf<dim_energy> U, Representation Rep = double>
using energy = quantity<dim_energy, U, Rep>;
@@ -37,9 +37,9 @@ namespace units::isq::si::fps {
struct foot_poundal_per_second : unit<foot_poundal_per_second> {};
struct dim_power : isq::dim_power<dim_power, foot_poundal_per_second, dim_energy, dim_time> {};
struct dim_power : isq::dim_power<dim_power, foot_poundal_per_second, dim_length, dim_force, dim_time> {};
struct foot_pound_force_per_second : derived_unit<foot_pound_force_per_second, dim_power, foot_pound_force, second> {};
struct foot_pound_force_per_second : derived_unit<foot_pound_force_per_second, dim_power, foot, pound_force, second> {};
struct horse_power : named_scaled_unit<horse_power, "hp", no_prefix, ratio(550), foot_pound_force_per_second> {};