refactor: degree Celsius and Fahrenheit symbols text now use Unicode codepoints

This commit is contained in:
Mateusz Pusz
2024-07-02 11:43:53 +01:00
parent e41078b889
commit 1365d62293
6 changed files with 12 additions and 12 deletions

View File

@@ -39,7 +39,7 @@ using enum unit_symbol_separator;
static_assert(unit_symbol(metre) == "m");
static_assert(unit_symbol(second) == "s");
static_assert(unit_symbol(joule) == "J");
static_assert(unit_symbol(degree_Celsius) == "\u00B0C");
static_assert(unit_symbol(degree_Celsius) == "\u2103");
static_assert(unit_symbol<unit_symbol_formatting{.encoding = ascii}>(degree_Celsius) == "`C");
static_assert(unit_symbol(kilogram) == "kg");
static_assert(unit_symbol(hour) == "h");

View File

@@ -66,7 +66,7 @@ inline constexpr struct newton_ final : named_unit<"N", kilogram * metre / squar
inline constexpr struct pascal_ final : named_unit<"Pa", newton / square(metre)> {} pascal;
inline constexpr struct joule_ final : named_unit<"J", newton * metre> {} joule;
inline constexpr struct watt_ final : named_unit<"W", joule / second> {} watt;
inline constexpr struct degree_Celsius_ final : named_unit<symbol_text{u8"°C", "`C"}, kelvin> {} degree_Celsius;
inline constexpr struct degree_Celsius_ final : named_unit<symbol_text{u8"", "`C"}, kelvin> {} degree_Celsius;
inline constexpr struct minute_ final : named_unit<"min", mag<60> * second> {} minute;
inline constexpr struct hour_ final : named_unit<"h", mag<60> * minute> {} hour;