mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-06 05:34:27 +02:00
refactor: Unicode symbols directly provided in the code
This commit is contained in:
@@ -32,7 +32,7 @@ struct one; // defined in <units/unit.h>
|
||||
|
||||
// clang-format off
|
||||
inline constexpr struct percent : named_unit<"%", mag<ratio(1, 100)> * one> {} percent;
|
||||
inline constexpr struct per_mille : named_unit<basic_symbol_text{"\u2030", "%o"}, mag<ratio(1, 1000)> * one> {} per_mille;
|
||||
inline constexpr struct per_mille : named_unit<basic_symbol_text{"‰", "%o"}, mag<ratio(1, 1000)> * one> {} per_mille;
|
||||
// clang-format on
|
||||
|
||||
} // namespace units
|
||||
|
@@ -33,7 +33,7 @@ template<PrefixableUnit auto U> struct atto_ : prefixed_unit<"a", mag_power<10,
|
||||
template<PrefixableUnit auto U> struct femto_ : prefixed_unit<"f", mag_power<10, -15>, U> {};
|
||||
template<PrefixableUnit auto U> struct pico_ : prefixed_unit<"p", mag_power<10, -12>, U> {};
|
||||
template<PrefixableUnit auto U> struct nano_ : prefixed_unit<"n", mag_power<10, -9>, U> {};
|
||||
template<PrefixableUnit auto U> struct micro_ : prefixed_unit<basic_symbol_text{"\u00b5", "u"}, mag_power<10, -6>, U> {};
|
||||
template<PrefixableUnit auto U> struct micro_ : prefixed_unit<basic_symbol_text{"µ", "u"}, mag_power<10, -6>, U> {};
|
||||
template<PrefixableUnit auto U> struct milli_ : prefixed_unit<"m", mag_power<10, -3>, U> {};
|
||||
template<PrefixableUnit auto U> struct centi_ : prefixed_unit<"c", mag_power<10, -2>, U> {};
|
||||
template<PrefixableUnit auto U> struct deci_ : prefixed_unit<"d", mag_power<10, -1>, U> {};
|
||||
|
@@ -50,12 +50,12 @@ inline constexpr struct watt : named_unit<"W", joule / second> {} watt;
|
||||
inline constexpr struct coulomb : named_unit<"C", ampere * second> {} coulomb;
|
||||
inline constexpr struct volt : named_unit<"V", watt / ampere> {} volt;
|
||||
inline constexpr struct farad : named_unit<"F", coulomb / volt> {} farad;
|
||||
inline constexpr struct ohm : named_unit<basic_symbol_text{"\u03A9", "ohm"}, volt / ampere> {} ohm;
|
||||
inline constexpr struct ohm : named_unit<basic_symbol_text{"Ω", "ohm"}, volt / ampere> {} ohm;
|
||||
inline constexpr struct siemens : named_unit<"S", 1 / ohm> {} siemens;
|
||||
inline constexpr struct weber : named_unit<"Wb", volt * second> {} weber;
|
||||
inline constexpr struct tesla : named_unit<"T", weber / square<metre>> {} tesla;
|
||||
inline constexpr struct henry : named_unit<"H", weber / ampere> {} henry;
|
||||
inline constexpr struct degree_Celsius : named_unit<basic_symbol_text{"\u00B0C", "`C"}, kelvin> {} degree_Celsius;
|
||||
inline constexpr struct degree_Celsius : named_unit<basic_symbol_text{"°C", "`C"}, kelvin> {} degree_Celsius;
|
||||
inline constexpr struct lumen : named_unit<"lm", candela * steradian> {} lumen;
|
||||
inline constexpr struct lux : named_unit<"lx", lumen / square<metre>> {} lux;
|
||||
inline constexpr struct becquerel : named_unit<"Bq", 1 / second> {} becquerel;
|
||||
|
@@ -60,7 +60,7 @@ inline constexpr struct newton_ : named_unit<"N", kilogram * metre / square<seco
|
||||
inline constexpr struct pascal_ : named_unit<"Pa", newton / square<metre>> {} pascal;
|
||||
inline constexpr struct joule_ : named_unit<"J", newton * metre> {} joule;
|
||||
inline constexpr struct watt_ : named_unit<"W", joule / second> {} watt;
|
||||
inline constexpr struct degree_Celsius_ : named_unit<basic_symbol_text{"\u00B0C", "`C"}, kelvin> {} degree_Celsius;
|
||||
inline constexpr struct degree_Celsius_ : named_unit<basic_symbol_text{"°C", "`C"}, kelvin> {} degree_Celsius;
|
||||
|
||||
inline constexpr struct minute_ : named_unit<"min", mag<60> * second> {} minute;
|
||||
inline constexpr struct hour_ : named_unit<"h", mag<60> * minute> {} hour;
|
||||
|
Reference in New Issue
Block a user