diff --git a/src/include/units/dimensions/energy.h b/src/include/units/dimensions/energy.h index 912a5d0d..68245abf 100644 --- a/src/include/units/dimensions/energy.h +++ b/src/include/units/dimensions/energy.h @@ -27,13 +27,17 @@ #include namespace units { - + struct energy : derived_dimension, exp> {}; template concept Energy = QuantityOf; struct joule : derived_unit {}; + struct millijoule : derived_unit> {}; + struct kilojoule : derived_unit> {}; + struct megajoule : derived_unit> {}; + struct gigajoule : derived_unit> {}; inline namespace literals { @@ -41,6 +45,22 @@ namespace units { constexpr auto operator""_J(unsigned long long l) { return quantity(l); } constexpr auto operator""_J(long double l) { return quantity(l); } + // mJ + constexpr auto operator""mJ(unsigned long long l) { return quantity(l); } + constexpr auto operator""mJ(long double l) { return quantity(l); } + + // kJ + constexpr auto operator""kJ(unsigned long long l) { return quantity(l); } + constexpr auto operator""kJ(long double l) { return quantity(l); } + + // MJ + constexpr auto operator""MJ(unsigned long long l) { return quantity(l); } + constexpr auto operator""MJ(long double l) { return quantity(l); } + + // GJ + constexpr auto operator""GJ(unsigned long long l) { return quantity(l); } + constexpr auto operator""GJ(long double l) { return quantity(l); } + } // namespace literals } // namespace units diff --git a/src/include/units/dimensions/power.h b/src/include/units/dimensions/power.h index ad76a4fa..0f09ec3f 100644 --- a/src/include/units/dimensions/power.h +++ b/src/include/units/dimensions/power.h @@ -33,6 +33,10 @@ namespace units { concept Power = QuantityOf; struct watt : derived_unit {}; + struct milliwatt : derived_unit> {}; + struct kilowatt : derived_unit> {}; + struct megawatt : derived_unit> {}; + struct gigawatt : derived_unit> {}; inline namespace literals { @@ -40,6 +44,22 @@ namespace units { constexpr auto operator""W(unsigned long long l) { return quantity(l); } constexpr auto operator""_W(long double l) { return quantity(l); } + // mW + constexpr auto operator""mW(unsigned long long l) { return quantity(l); } + constexpr auto operator""mW(long double l) { return quantity(l); } + + // kW + constexpr auto operator""kW(unsigned long long l) { return quantity(l); } + constexpr auto operator""kW(long double l) { return quantity(l); } + + // MW + constexpr auto operator""MW(unsigned long long l) { return quantity(l); } + constexpr auto operator""MW(long double l) { return quantity(l); } + + // GW + constexpr auto operator""GW(unsigned long long l) { return quantity(l); } + constexpr auto operator""GW(long double l) { return quantity(l); } + } // namespace literals } // namespace units