Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mpusz/units
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Mar 3, 2024
2 parents a04cc62 + 5675002 commit e7fdc96
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions docs/blog/posts/2.2.0-released.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**).


## 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

With this release we can print not only whole quantities but also just their units or dimensions.
Expand Down Expand Up @@ -214,27 +235,6 @@ Also, we have finally added proper implementations of `value_cast` and `quantity
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

This release made a few small refactorings that without changing the user-facing API allowed us
Expand Down

0 comments on commit e7fdc96

Please sign in to comment.