mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-02 20:04:27 +02:00
docs: "Changes to units definitions" chapter reordered in TOC in the 2.2 release announcement
This commit is contained in:
@@ -165,6 +165,27 @@ With this release, the last one was renamed to `usc::zeroth_degree_Fahrenheit` t
|
|||||||
named with its corresponding unit and with the `si::zeroth_degree_Celsius` (**breaking change**).
|
named with its corresponding unit and with the `si::zeroth_degree_Celsius` (**breaking change**).
|
||||||
|
|
||||||
|
|
||||||
|
## Changes to units definitions
|
||||||
|
|
||||||
|
[WG21 Study Group 16 (Unicode) raised concerns](https://github.com/sg16-unicode/sg16-meetings#january-24th-2024)
|
||||||
|
about potential ABI issues when different translation units are compiled with different ordinary
|
||||||
|
literal encodings. Those issues were resolved with a change to units definitions (**breaking
|
||||||
|
change**). It affects only units that specify both Unicode and ASCII symbols. The new design
|
||||||
|
requires the Unicode symbol to be provided as a UTF-8 literal:
|
||||||
|
|
||||||
|
=== "Now"
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
inline constexpr struct ohm : named_unit<{u8"Ω", "ohm"}, volt / ampere> {} ohm;
|
||||||
|
```
|
||||||
|
|
||||||
|
=== "Before"
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
inline constexpr struct ohm : named_unit<{"Ω", "ohm"}, volt / ampere> {} ohm;
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Improved text output
|
## Improved text output
|
||||||
|
|
||||||
With this release we can print not only whole quantities but also just their units or dimensions.
|
With this release we can print not only whole quantities but also just their units or dimensions.
|
||||||
@@ -214,27 +235,6 @@ Also, we have finally added proper implementations of `value_cast` and `quantity
|
|||||||
quantity points.
|
quantity points.
|
||||||
|
|
||||||
|
|
||||||
## Changes to units definitions
|
|
||||||
|
|
||||||
[WG21 Study Group 16 (Unicode) raised concerns](https://github.com/sg16-unicode/sg16-meetings#january-24th-2024)
|
|
||||||
about potential ABI issues when different translation units are compiled with different ordinary
|
|
||||||
literal encodings. Those issues were resolved with a change to units definitions (**breaking
|
|
||||||
change**). It affects only units that specify both Unicode and ASCII symbols. The new design
|
|
||||||
requires the Unicode symbol to be provided as a UTF-8 literal:
|
|
||||||
|
|
||||||
=== "Now"
|
|
||||||
|
|
||||||
```cpp
|
|
||||||
inline constexpr struct ohm : named_unit<{u8"Ω", "ohm"}, volt / ampere> {} ohm;
|
|
||||||
```
|
|
||||||
|
|
||||||
=== "Before"
|
|
||||||
|
|
||||||
```cpp
|
|
||||||
inline constexpr struct ohm : named_unit<{"Ω", "ohm"}, volt / ampere> {} ohm;
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Even better error messages
|
## Even better error messages
|
||||||
|
|
||||||
This release made a few small refactorings that without changing the user-facing API allowed us
|
This release made a few small refactorings that without changing the user-facing API allowed us
|
||||||
|
Reference in New Issue
Block a user