Rename as_magnitude<...>() to mag<...>()

This is easier to write and to read.
This commit is contained in:
Chip Hogg committed 2022-07-29 01:46:06 +00:00
1 parent 4912bac0c5
commit ea83af8aa9
36 files changed
+196 -217

No files matched your search

@@ -58,7 +58,7 @@ struct exakatal : prefixed_unit<exakatal, exa, katal> {};
struct zettakatal : prefixed_unit<zettakatal, zetta, katal> {};
struct yottakatal : prefixed_unit<yottakatal, yotta, katal> {};
struct enzyme_unit : named_scaled_unit<enzyme_unit, "U", as_magnitude<ratio(1, 60)>() * mag_power<10, -6>(), katal> {};
struct enzyme_unit : named_scaled_unit<enzyme_unit, "U", mag<ratio(1, 60)>() * mag_power<10, -6>(), katal> {};
struct dim_catalytic_activity :
isq::dim_catalytic_activity<dim_catalytic_activity, katal, dim_time, dim_amount_of_substance> {};
+1 -2
View File
@@ -56,8 +56,7 @@ struct yottajoule : prefixed_unit<yottajoule, yotta, joule> {};
// N.B. electron charge (and eV) is an exact constant:
// https://www.bipm.org/documents/20126/41483022/SI-Brochure-9.pdf#page=147
struct electronvolt :
named_scaled_unit<electronvolt, "eV", as_magnitude<ratio(1'602'176'634, 1'000'000'000)>() * mag_power<10, -19>(),
joule> {};
named_scaled_unit<electronvolt, "eV", mag<ratio(1'602'176'634, 1'000'000'000)>() * mag_power<10, -19>(), joule> {};
struct gigaelectronvolt : prefixed_unit<gigaelectronvolt, giga, electronvolt> {};
struct dim_energy : isq::dim_energy<dim_energy, joule, dim_force, dim_length> {};
+1 -1
View File
@@ -56,7 +56,7 @@ struct exametre : prefixed_unit<exametre, exa, metre> {};
struct zettametre : prefixed_unit<zettametre, zetta, metre> {};
struct yottametre : prefixed_unit<yottametre, yotta, metre> {};
struct astronomical_unit : named_scaled_unit<astronomical_unit, "au", as_magnitude<149'597'870'700>(), metre> {};
struct astronomical_unit : named_scaled_unit<astronomical_unit, "au", mag<149'597'870'700>(), metre> {};
struct dim_length : isq::dim_length<metre> {};
@@ -36,7 +36,7 @@ namespace units::isq::si {
// TODO Is this correct? Should we account for steradian here? How?
struct lumen : named_scaled_unit<lumen, "lm", as_magnitude<ratio(1, 683)>(), watt> {};
struct lumen : named_scaled_unit<lumen, "lm", mag<ratio(1, 683)>(), watt> {};
using dim_luminous_flux = dim_power;
@@ -56,7 +56,7 @@ struct exatesla : prefixed_unit<exatesla, exa, tesla> {};
struct zettatesla : prefixed_unit<zettatesla, zetta, tesla> {};
struct yottatesla : prefixed_unit<yottatesla, yotta, tesla> {};
struct gauss : named_scaled_unit<gauss, "G", as_magnitude<ratio(1, 10'000)>(), tesla> {};
struct gauss : named_scaled_unit<gauss, "G", mag<ratio(1, 10'000)>(), tesla> {};
struct dim_magnetic_induction :
isq::dim_magnetic_induction<dim_magnetic_induction, tesla, dim_voltage, dim_time, dim_length> {};
+2 -3
View File
@@ -79,9 +79,8 @@ struct zettatonne : prefixed_unit<zettatonne, zetta, tonne> {};
struct yottatonne : prefixed_unit<yottatonne, yotta, tonne> {};
struct dalton :
named_scaled_unit<dalton, "Da",
as_magnitude<ratio(16'605'390'666'050, 10'000'000'000'000)>() * mag_power<10, -27>(), kilogram> {
};
named_scaled_unit<dalton, "Da", mag<ratio(16'605'390'666'050, 10'000'000'000'000)>() * mag_power<10, -27>(),
kilogram> {};
struct dim_mass : isq::dim_mass<kilogram> {};
+20 -20
View File
@@ -27,26 +27,26 @@
namespace units::isq::si {
// clang-format off
struct yocto : prefix<yocto, "y", pow<-24>(as_magnitude<10>())> {};
struct zepto : prefix<zepto, "z", pow<-21>(as_magnitude<10>())> {};
struct atto : prefix<atto, "a", pow<-18>(as_magnitude<10>())> {};
struct femto : prefix<femto, "f", pow<-15>(as_magnitude<10>())> {};
struct pico : prefix<pico, "p", pow<-12>(as_magnitude<10>())> {};
struct nano : prefix<nano, "n", pow<-9>(as_magnitude<10>())> {};
struct micro : prefix<micro, basic_symbol_text{"\u00b5", "u"}, pow<-6>(as_magnitude<10>())> {};
struct milli : prefix<milli, "m", pow<-3>(as_magnitude<10>())> {};
struct centi : prefix<centi, "c", pow<-2>(as_magnitude<10>())> {};
struct deci : prefix<deci, "d", pow<-1>(as_magnitude<10>())> {};
struct deca : prefix<deca, "da", pow<1>(as_magnitude<10>())> {};
struct hecto : prefix<hecto, "h", pow<2>(as_magnitude<10>())> {};
struct kilo : prefix<kilo, "k", pow<3>(as_magnitude<10>())> {};
struct mega : prefix<mega, "M", pow<6>(as_magnitude<10>())> {};
struct giga : prefix<giga, "G", pow<9>(as_magnitude<10>())> {};
struct tera : prefix<tera, "T", pow<12>(as_magnitude<10>())> {};
struct peta : prefix<peta, "P", pow<15>(as_magnitude<10>())> {};
struct exa : prefix<exa, "E", pow<18>(as_magnitude<10>())> {};
struct zetta : prefix<zetta, "Z", pow<21>(as_magnitude<10>())> {};
struct yotta : prefix<yotta, "Y", pow<24>(as_magnitude<10>())> {};
struct yocto : prefix<yocto, "y", pow<-24>(mag<10>())> {};
struct zepto : prefix<zepto, "z", pow<-21>(mag<10>())> {};
struct atto : prefix<atto, "a", pow<-18>(mag<10>())> {};
struct femto : prefix<femto, "f", pow<-15>(mag<10>())> {};
struct pico : prefix<pico, "p", pow<-12>(mag<10>())> {};
struct nano : prefix<nano, "n", pow<-9>(mag<10>())> {};
struct micro : prefix<micro, basic_symbol_text{"\u00b5", "u"}, pow<-6>(mag<10>())> {};
struct milli : prefix<milli, "m", pow<-3>(mag<10>())> {};
struct centi : prefix<centi, "c", pow<-2>(mag<10>())> {};
struct deci : prefix<deci, "d", pow<-1>(mag<10>())> {};
struct deca : prefix<deca, "da", pow<1>(mag<10>())> {};
struct hecto : prefix<hecto, "h", pow<2>(mag<10>())> {};
struct kilo : prefix<kilo, "k", pow<3>(mag<10>())> {};
struct mega : prefix<mega, "M", pow<6>(mag<10>())> {};
struct giga : prefix<giga, "G", pow<9>(mag<10>())> {};
struct tera : prefix<tera, "T", pow<12>(mag<10>())> {};
struct peta : prefix<peta, "P", pow<15>(mag<10>())> {};
struct exa : prefix<exa, "E", pow<18>(mag<10>())> {};
struct zetta : prefix<zetta, "Z", pow<21>(mag<10>())> {};
struct yotta : prefix<yotta, "Y", pow<24>(mag<10>())> {};
// clang-format on
} // namespace units::isq::si
+3 -3
View File
@@ -43,9 +43,9 @@ struct picosecond : prefixed_unit<picosecond, pico, second> {};
struct nanosecond : prefixed_unit<nanosecond, nano, second> {};
struct microsecond : prefixed_unit<microsecond, micro, second> {};
struct millisecond : prefixed_unit<millisecond, milli, second> {};
struct minute : named_scaled_unit<minute, "min", as_magnitude<60>(), second> {};
struct hour : named_scaled_unit<hour, "h", as_magnitude<60>(), minute> {};
struct day : named_scaled_unit<day, "d", as_magnitude<24>(), hour> {};
struct minute : named_scaled_unit<minute, "min", mag<60>(), second> {};
struct hour : named_scaled_unit<hour, "h", mag<60>(), minute> {};
struct day : named_scaled_unit<day, "d", mag<24>(), hour> {};
struct dim_time : isq::dim_time<second> {};