Skip to content

Commit

Permalink
feat: ABI concerns resolved with introduction of u8 strings for symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Feb 16, 2024
1 parent 54dbeea commit cb858f1
Show file tree
Hide file tree
Showing 18 changed files with 112 additions and 93 deletions.
4 changes: 2 additions & 2 deletions docs/users_guide/framework_basics/dimensionless_quantities.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ units of _length_:
```cpp
inline constexpr struct hubble_constant :
named_unit<basic_symbol_text{"H₀", "H_0"}, mag<ratio{701, 10}> * si::kilo<si::metre> / si::second / si::mega<parsec>> {} hubble_constant;
named_unit<{u8"H₀", "H_0"}, mag<ratio{701, 10}> * si::kilo<si::metre> / si::second / si::mega<parsec>> {} hubble_constant;
```


Expand Down Expand Up @@ -159,7 +159,7 @@ with dimensionless quantities:

```cpp
inline constexpr struct percent : named_unit<"%", mag<ratio{1, 100}> * one> {} percent;
inline constexpr struct per_mille : named_unit<basic_symbol_text{"‰", "%o"}, mag<ratio(1, 1000)> * one> {} per_mille;
inline constexpr struct per_mille : named_unit<{u8"‰", "%o"}, mag<ratio(1, 1000)> * one> {} per_mille;
inline constexpr struct parts_per_million : named_unit<"ppm", mag<ratio(1, 1'000'000)> * one> {} parts_per_million;
inline constexpr auto ppm = parts_per_million;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ inline constexpr struct speed_of_light_in_vacuum :
} // namespace si2019

inline constexpr struct magnetic_constant :
named_unit<basic_symbol_text{"μ₀", "u_0"}, mag<4> * mag_pi * mag_power<10, -7> * henry / metre> {} magnetic_constant;
named_unit<{u8"μ₀", "u_0"}, mag<4> * mag_pi * mag_power<10, -7> * henry / metre> {} magnetic_constant;

} // namespace mp_units::si
```
Expand Down
2 changes: 1 addition & 1 deletion docs/users_guide/framework_basics/systems_of_units.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,5 @@ inline constexpr struct mag_pi : magnitude<std::numbers::pi_v<long double>> {} m
```

```cpp
inline constexpr struct degree : named_unit<basic_symbol_text{"°", "deg"}, mag_pi / mag<180> * si::radian> {} degree;
inline constexpr struct degree : named_unit<{u8"°", "deg"}, mag_pi / mag<180> * si::radian> {} degree;
```
5 changes: 2 additions & 3 deletions docs/users_guide/framework_basics/the_affine_space.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,15 +472,14 @@ namespace si {
inline constexpr struct kelvin :
named_unit<"K", kind_of<isq::thermodynamic_temperature>, zeroth_kelvin> {} kelvin;
inline constexpr struct degree_Celsius :
named_unit<basic_symbol_text{"°C", "`C"}, kelvin, zeroth_degree_Celsius> {} degree_Celsius;
named_unit<{u8"°C", "`C"}, kelvin, zeroth_degree_Celsius> {} degree_Celsius;
}
namespace usc {
inline constexpr struct degree_Fahrenheit :
named_unit<basic_symbol_text{"°F", "`F"}, mag<ratio{5, 9}> * si::degree_Celsius,
zeroth_degree_Fahrenheit> {} degree_Fahrenheit;
named_unit<{u8"°F", "`F"}, mag<ratio{5, 9}> * si::degree_Celsius, zeroth_degree_Fahrenheit> {} degree_Fahrenheit;
}
```
Expand Down
3 changes: 3 additions & 0 deletions src/core/include/mp-units/bits/external/fixed_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ basic_fixed_string(const CharT* ptr, std::integral_constant<std::size_t, N>) ->
template<std::size_t N>
using fixed_string = basic_fixed_string<char, N>;

template<std::size_t N>
using fixed_u8string = basic_fixed_string<char8_t, N>;

} // namespace mp_units

template<typename CharT, std::size_t N>
Expand Down
2 changes: 1 addition & 1 deletion src/core/include/mp-units/bits/magnitude.h
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ template<typename T, auto... Ms>
return integer_part((detail::abs(power_of_2) < detail::abs(power_of_5)) ? power_of_2 : power_of_5);
}

inline constexpr basic_symbol_text base_multiplier("× 10", "x 10");
inline constexpr basic_symbol_text base_multiplier(u8"× 10", "x 10");

template<Magnitude auto M>
[[nodiscard]] consteval auto magnitude_text()
Expand Down
67 changes: 41 additions & 26 deletions src/core/include/mp-units/bits/symbol_text.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,21 @@

#include <gsl/gsl-lite.hpp>

#if __cpp_lib_text_encoding
#include <text_encoding>
static_assert(std::text_encoding::literal().mib() == std::text_encoding::id::UTF8);
#endif

namespace mp_units {

namespace detail {

constexpr void validate_ascii_char([[maybe_unused]] char c) noexcept { gsl_Expects((c & 0x80) == 0); }
constexpr void validate_ascii_char([[maybe_unused]] char c) noexcept
{
// check if character belongs to basic character literal set
// https://en.cppreference.com/w/cpp/language/charset
gsl_Expects(c == 0x00 || (0x07 <= c && c <= 0x0D) || (0x20 <= c && c <= 0x7E));
}

template<std::size_t N>
constexpr void validate_ascii_string([[maybe_unused]] const char (&s)[N + 1]) noexcept
Expand All @@ -47,6 +57,12 @@ constexpr void validate_ascii_string([[maybe_unused]] const char (&s)[N + 1]) no
#endif
}

template<std::size_t N>
constexpr fixed_u8string<N> to_u8string(fixed_string<N> txt)
{
return std::bit_cast<fixed_u8string<N>>(txt);
}

} // namespace detail


Expand All @@ -57,37 +73,37 @@ constexpr void validate_ascii_string([[maybe_unused]] const char (&s)[N + 1]) no
* representation. In the libary it is used to define symbols of units and prefixes.
* Each symbol can have two versions: Unicode and ASCI-only.
*
* @tparam UnicodeCharT Character type to be used for a Unicode representation
* @tparam N The size of a Unicode symbol
* @tparam M The size of the ASCII-only symbol
*/
template<typename UnicodeCharT, std::size_t N, std::size_t M>
template<std::size_t N, std::size_t M>
struct basic_symbol_text {
basic_fixed_string<UnicodeCharT, N> unicode_;
basic_fixed_string<char, M> ascii_;
fixed_u8string<N> unicode_;
fixed_string<M> ascii_;

constexpr explicit(false) basic_symbol_text(char txt) : unicode_(txt), ascii_(txt)
constexpr explicit(false) basic_symbol_text(char txt) : unicode_(static_cast<char8_t>(txt)), ascii_(txt)
{
detail::validate_ascii_char(txt);
}

constexpr explicit(false) basic_symbol_text(const char (&txt)[N + 1]) : unicode_(txt), ascii_(txt)
constexpr explicit(false) basic_symbol_text(const char (&txt)[N + 1]) :
unicode_(detail::to_u8string(basic_fixed_string{txt})), ascii_(txt)
{
detail::validate_ascii_string<N>(txt);
}

constexpr explicit(false) basic_symbol_text(const basic_fixed_string<char, N>& txt) : unicode_(txt), ascii_(txt)
constexpr explicit(false) basic_symbol_text(const fixed_string<N>& txt) :
unicode_(detail::to_u8string(txt)), ascii_(txt)
{
detail::validate_ascii_string<N>(txt.data_);
}

constexpr basic_symbol_text(const UnicodeCharT (&u)[N + 1], const char (&a)[M + 1]) : unicode_(u), ascii_(a)
constexpr basic_symbol_text(const char8_t (&u)[N + 1], const char (&a)[M + 1]) : unicode_(u), ascii_(a)
{
detail::validate_ascii_string<M>(a);
}

constexpr basic_symbol_text(const basic_fixed_string<UnicodeCharT, N>& u, const basic_fixed_string<char, M>& a) :
unicode_(u), ascii_(a)
constexpr basic_symbol_text(const fixed_u8string<N>& u, const fixed_string<M>& a) : unicode_(u), ascii_(a)
{
detail::validate_ascii_string<M>(a.data_);
}
Expand All @@ -98,15 +114,15 @@ struct basic_symbol_text {
[[nodiscard]] constexpr bool empty() const { return unicode().empty() && ascii().empty(); }

template<std::size_t N2, std::size_t M2>
[[nodiscard]] constexpr friend basic_symbol_text<UnicodeCharT, N + N2, M + M2> operator+(
const basic_symbol_text& lhs, const basic_symbol_text<UnicodeCharT, N2, M2>& rhs)
[[nodiscard]] constexpr friend basic_symbol_text<N + N2, M + M2> operator+(const basic_symbol_text& lhs,
const basic_symbol_text<N2, M2>& rhs)
{
return basic_symbol_text<UnicodeCharT, N + N2, M + M2>(lhs.unicode() + rhs.unicode(), lhs.ascii() + rhs.ascii());
return basic_symbol_text<N + N2, M + M2>(lhs.unicode() + rhs.unicode(), lhs.ascii() + rhs.ascii());
}

template<typename UnicodeCharT2, std::size_t N2, std::size_t M2>
template<std::size_t N2, std::size_t M2>
[[nodiscard]] friend constexpr auto operator<=>(const basic_symbol_text& lhs,
const basic_symbol_text<UnicodeCharT2, N2, M2>& rhs) noexcept
const basic_symbol_text<N2, M2>& rhs) noexcept
{
MP_UNITS_DIAGNOSTIC_PUSH
MP_UNITS_DIAGNOSTIC_IGNORE_ZERO_AS_NULLPOINTER_CONSTANT
Expand All @@ -115,27 +131,26 @@ struct basic_symbol_text {
return lhs.ascii() <=> rhs.ascii();
}

template<typename UnicodeCharT2, std::size_t N2, std::size_t M2>
template<std::size_t N2, std::size_t M2>
[[nodiscard]] friend constexpr bool operator==(const basic_symbol_text& lhs,
const basic_symbol_text<UnicodeCharT2, N2, M2>& rhs) noexcept
const basic_symbol_text<N2, M2>& rhs) noexcept
{
return lhs.unicode() == rhs.unicode() && lhs.ascii() == rhs.ascii();
}
};

basic_symbol_text(char) -> basic_symbol_text<char, 1, 1>;
basic_symbol_text(char) -> basic_symbol_text<1, 1>;

template<std::size_t N>
basic_symbol_text(const char (&)[N]) -> basic_symbol_text<char, N - 1, N - 1>;
basic_symbol_text(const char (&)[N]) -> basic_symbol_text<N - 1, N - 1>;

template<std::size_t N>
basic_symbol_text(const basic_fixed_string<char, N>&) -> basic_symbol_text<char, N, N>;
basic_symbol_text(const fixed_string<N>&) -> basic_symbol_text<N, N>;

template<typename UnicodeCharT, std::size_t N, std::size_t M>
basic_symbol_text(const UnicodeCharT (&)[N], const char (&)[M]) -> basic_symbol_text<UnicodeCharT, N - 1, M - 1>;
template<std::size_t N, std::size_t M>
basic_symbol_text(const char8_t (&)[N], const char (&)[M]) -> basic_symbol_text<N - 1, M - 1>;

template<typename UnicodeCharT, std::size_t N, std::size_t M>
basic_symbol_text(const basic_fixed_string<UnicodeCharT, N>&, const basic_fixed_string<char, M>&)
-> basic_symbol_text<UnicodeCharT, N, M>;
template<std::size_t N, std::size_t M>
basic_symbol_text(const fixed_u8string<N>&, const fixed_string<M>&) -> basic_symbol_text<N, M>;

} // namespace mp_units
26 changes: 13 additions & 13 deletions src/core/include/mp-units/bits/text_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,32 @@ namespace mp_units::detail {

template<std::intmax_t Value>
requires(0 <= Value) && (Value < 10)
inline constexpr basic_fixed_string superscript_number = "";
inline constexpr basic_fixed_string superscript_number = u8"";

template<>
inline constexpr basic_fixed_string superscript_number<0> = "\u2070";
inline constexpr basic_fixed_string superscript_number<0> = u8"\u2070";
template<>
inline constexpr basic_fixed_string superscript_number<1> = "\u00b9";
inline constexpr basic_fixed_string superscript_number<1> = u8"\u00b9";
template<>
inline constexpr basic_fixed_string superscript_number<2> = "\u00b2";
inline constexpr basic_fixed_string superscript_number<2> = u8"\u00b2";
template<>
inline constexpr basic_fixed_string superscript_number<3> = "\u00b3";
inline constexpr basic_fixed_string superscript_number<3> = u8"\u00b3";
template<>
inline constexpr basic_fixed_string superscript_number<4> = "\u2074";
inline constexpr basic_fixed_string superscript_number<4> = u8"\u2074";
template<>
inline constexpr basic_fixed_string superscript_number<5> = "\u2075";
inline constexpr basic_fixed_string superscript_number<5> = u8"\u2075";
template<>
inline constexpr basic_fixed_string superscript_number<6> = "\u2076";
inline constexpr basic_fixed_string superscript_number<6> = u8"\u2076";
template<>
inline constexpr basic_fixed_string superscript_number<7> = "\u2077";
inline constexpr basic_fixed_string superscript_number<7> = u8"\u2077";
template<>
inline constexpr basic_fixed_string superscript_number<8> = "\u2078";
inline constexpr basic_fixed_string superscript_number<8> = u8"\u2078";
template<>
inline constexpr basic_fixed_string superscript_number<9> = "\u2079";
inline constexpr basic_fixed_string superscript_number<9> = u8"\u2079";

inline constexpr basic_symbol_text superscript_minus("\u207b", "-");
inline constexpr basic_symbol_text superscript_minus(u8"\u207b", "-");

inline constexpr basic_symbol_text superscript_prefix("", "^");
inline constexpr basic_symbol_text superscript_prefix(u8"", "^");

template<std::intmax_t Value>
[[nodiscard]] consteval auto superscript_helper()
Expand Down
18 changes: 10 additions & 8 deletions src/core/include/mp-units/unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ inline constexpr bool is_specialization_of_scaled_unit<scaled_unit<M, U>> = true
* inline constexpr struct metre : named_unit<"m", length> {} metre;
* inline constexpr struct hertz : named_unit<"Hz", inverse(second)> {} hertz;
* inline constexpr struct newton : named_unit<"N", kilogram * metre / square(second)> {} newton;
* inline constexpr struct degree_Celsius : named_unit<basic_symbol_text{"°C", "`C"}, kelvin> {} degree_Celsius;
* inline constexpr struct degree_Celsius : named_unit<{u8"°C", "`C"}, kelvin> {} degree_Celsius;
* inline constexpr struct minute : named_unit<"min", mag<60> * second> {} minute;
* @endcode
*
Expand Down Expand Up @@ -604,7 +604,7 @@ template<std::intmax_t Num, std::intmax_t Den = 1, Unit U>
// common dimensionless units
// 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{"", "%o"}, mag<ratio(1, 1000)> * one> {} per_mille;
inline constexpr struct per_mille : named_unit<basic_symbol_text{u8"", "%o"}, mag<ratio(1, 1000)> * one> {} per_mille;
inline constexpr struct parts_per_million : named_unit<"ppm", mag<ratio(1, 1'000'000)> * one> {} parts_per_million;
inline constexpr auto ppm = parts_per_million;
// clang-format on
Expand Down Expand Up @@ -699,17 +699,19 @@ struct unit_symbol_formatting {

namespace detail {

// TODO Should `basic_symbol_text` be fixed to use `char` type for both encodings?
template<typename CharT, typename UnicodeCharT, std::size_t N, std::size_t M, std::output_iterator<CharT> Out>
constexpr Out copy(const basic_symbol_text<UnicodeCharT, N, M>& txt, text_encoding encoding, Out out)
template<typename CharT, std::size_t N, std::size_t M, std::output_iterator<CharT> Out>
constexpr Out copy(const basic_symbol_text<N, M>& txt, text_encoding encoding, Out out)
{
if (encoding == text_encoding::unicode) {
if (is_same_v<CharT, UnicodeCharT>)
if constexpr (is_same_v<CharT, char8_t>)
return copy(txt.unicode(), out).out;
else
else if constexpr (is_same_v<CharT, char>) {
for (char8_t ch : txt.unicode()) *out++ = static_cast<char>(ch);
return out;
} else
throw std::invalid_argument("Unicode text can't be copied to CharT output");
} else {
if (is_same_v<CharT, char>)
if constexpr (is_same_v<CharT, char>)
return copy(txt.ascii(), out).out;
else
throw std::invalid_argument("ASCII text can't be copied to CharT output");
Expand Down
4 changes: 2 additions & 2 deletions src/systems/include/mp-units/systems/angular/units.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ QUANTITY_SPEC(solid_angle, pow<2>(angle));

inline constexpr struct radian : named_unit<"rad", kind_of<angle>> {} radian;
inline constexpr struct revolution : named_unit<"rev", mag<2> * mag_pi * radian> {} revolution;
inline constexpr struct degree : named_unit<basic_symbol_text{"°", "deg"}, mag<ratio{1, 360}> * revolution> {} degree;
inline constexpr struct gradian : named_unit<basic_symbol_text{"", "grad"}, mag<ratio{1, 400}> * revolution> {} gradian;
inline constexpr struct degree : named_unit<basic_symbol_text{u8"°", "deg"}, mag<ratio{1, 360}> * revolution> {} degree;
inline constexpr struct gradian : named_unit<basic_symbol_text{u8"", "grad"}, mag<ratio{1, 400}> * revolution> {} gradian;
inline constexpr struct steradian : named_unit<"sr", square(radian)> {} steradian;
// clang-format on

Expand Down
8 changes: 4 additions & 4 deletions src/systems/include/mp-units/systems/iau/iau.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ inline constexpr struct Julian_year : named_unit<"a", mag<ratio{365'25, 100}> *
// mass
// https://en.wikipedia.org/wiki/Solar_mass
// TODO What is the official mass of sun (every source in the Internet provides a different value)
inline constexpr struct solar_mass : named_unit<basic_symbol_text{"M_☉", "M_SUN"}, mag<ratio{198'847, 100'000}> * mag_power<10, 30> * si::kilogram> {} solar_mass;
inline constexpr struct solar_mass : named_unit<basic_symbol_text{u8"M_☉", "M_SUN"}, mag<ratio{198'847, 100'000}> * mag_power<10, 30> * si::kilogram> {} solar_mass;
inline constexpr struct Jupiter_mass : named_unit<"M_JUP", mag<ratio{1'898, 1'000}> * mag_power<10, 27> * si::kilogram> {} Jupiter_mass;
inline constexpr struct Earth_mass : named_unit<"M_EARTH", mag<ratio{59'742, 10'000}> * mag_power<10, 24> * si::kilogram> {} Earth_mass;

Expand All @@ -55,21 +55,21 @@ inline constexpr struct light_year : named_unit<"ly", mag<9'460'730'472'580'800>
inline constexpr struct parsec : named_unit<"pc", astronomical_unit / (mag<ratio{1, 60 * 60}> * si::degree)> {} parsec;

// https://en.wikipedia.org/wiki/Angstrom
inline constexpr struct angstrom : named_unit<basic_symbol_text{"Å", "A"}, mag_power<10, -10> * si::metre> {} angstrom;
inline constexpr struct angstrom : named_unit<basic_symbol_text{u8"Å", "A"}, mag_power<10, -10> * si::metre> {} angstrom;

// selected constants
// https://en.wikipedia.org/wiki/Astronomical_constant
inline constexpr struct gaussian_gravitational_constant :
named_unit<"k", mag<ratio{1'720'209'895, 100'000'000'000}> * pow<3, 2>(astronomical_unit) / pow<1,2>(solar_mass) / day> {} gaussian_gravitational_constant;

inline constexpr struct speed_of_light :
named_unit<basic_symbol_text{"c₀", "c_0"}, si::si2019::speed_of_light_in_vacuum> {} speed_of_light;
named_unit<basic_symbol_text{u8"c₀", "c_0"}, si::si2019::speed_of_light_in_vacuum> {} speed_of_light;

inline constexpr struct constant_of_gravitation :
named_unit<"G", mag<ratio{667'430, 100'000}> * mag_power<10, -11> * cubic(si::metre) / si::kilogram / square(si::second)> {} constant_of_gravitation;

inline constexpr struct hubble_constant :
named_unit<basic_symbol_text{"H₀", "H_0"}, mag<ratio{701, 10}> * si::kilo<si::metre> / si::second / si::mega<parsec>> {} hubble_constant;
named_unit<basic_symbol_text{u8"H₀", "H_0"}, mag<ratio{701, 10}> * si::kilo<si::metre> / si::second / si::mega<parsec>> {} hubble_constant;
// clang-format on

namespace unit_symbols {
Expand Down
2 changes: 1 addition & 1 deletion src/systems/include/mp-units/systems/isq/base_quantities.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ inline constexpr struct dim_length : base_dimension<"L"> {} dim_length;
inline constexpr struct dim_mass : base_dimension<"M"> {} dim_mass;
inline constexpr struct dim_time : base_dimension<"T"> {} dim_time;
inline constexpr struct dim_electric_current : base_dimension<"I"> {} dim_electric_current;
inline constexpr struct dim_thermodynamic_temperature : base_dimension<basic_symbol_text{"Θ", "O"}> {} dim_thermodynamic_temperature;
inline constexpr struct dim_thermodynamic_temperature : base_dimension<basic_symbol_text{u8"Θ", "O"}> {} dim_thermodynamic_temperature;
inline constexpr struct dim_amount_of_substance : base_dimension<"N"> {} dim_amount_of_substance;
inline constexpr struct dim_luminous_intensity : base_dimension<"J"> {} dim_luminous_intensity;
// clang-format on
Expand Down
6 changes: 3 additions & 3 deletions src/systems/include/mp-units/systems/si/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace si2019 {

// clang-format off
inline constexpr struct hyperfine_structure_transition_frequency_of_cs :
named_unit<basic_symbol_text{"Δν_Cs", "dv_Cs"}, mag<9'192'631'770> * hertz> {} hyperfine_structure_transition_frequency_of_cs;
named_unit<basic_symbol_text{u8"Δν_Cs", "dv_Cs"}, mag<9'192'631'770> * hertz> {} hyperfine_structure_transition_frequency_of_cs;
inline constexpr struct speed_of_light_in_vacuum :
named_unit<"c", mag<299'792'458> * metre / second> {} speed_of_light_in_vacuum;
inline constexpr struct planck_constant :
Expand All @@ -50,9 +50,9 @@ inline constexpr struct luminous_efficacy :

// clang-format off
inline constexpr struct standard_gravity :
named_unit<basic_symbol_text{"g₀", "g_0"}, mag<ratio{980'665, 100'000}> * metre / square(second)> {} standard_gravity;
named_unit<basic_symbol_text{u8"g₀", "g_0"}, mag<ratio{980'665, 100'000}> * metre / square(second)> {} standard_gravity;
inline constexpr struct magnetic_constant :
named_unit<basic_symbol_text{"μ₀", "u_0"}, mag<4> * mag_pi * mag_power<10, -7> * henry / metre> {} magnetic_constant;
named_unit<basic_symbol_text{u8"μ₀", "u_0"}, mag<4> * mag_pi * mag_power<10, -7> * henry / metre> {} magnetic_constant;
// clang-format on

} // namespace mp_units::si
2 changes: 1 addition & 1 deletion src/systems/include/mp-units/systems/si/prefixes.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ template<PrefixableUnit U> struct atto_ : prefixed_unit<"a", mag_power<10, -18>
template<PrefixableUnit U> struct femto_ : prefixed_unit<"f", mag_power<10, -15>, U{}> {};
template<PrefixableUnit U> struct pico_ : prefixed_unit<"p", mag_power<10, -12>, U{}> {};
template<PrefixableUnit U> struct nano_ : prefixed_unit<"n", mag_power<10, -9>, U{}> {};
template<PrefixableUnit U> struct micro_ : prefixed_unit<basic_symbol_text{"µ", "u"}, mag_power<10, -6>, U{}> {};
template<PrefixableUnit U> struct micro_ : prefixed_unit<basic_symbol_text{u8"µ", "u"}, mag_power<10, -6>, U{}> {};
template<PrefixableUnit U> struct milli_ : prefixed_unit<"m", mag_power<10, -3>, U{}> {};
template<PrefixableUnit U> struct centi_ : prefixed_unit<"c", mag_power<10, -2>, U{}> {};
template<PrefixableUnit U> struct deci_ : prefixed_unit<"d", mag_power<10, -1>, U{}> {};
Expand Down
Loading

0 comments on commit cb858f1

Please sign in to comment.