mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-30 02:17:16 +02:00
docs: 2.2 release annonuncement updated
This commit is contained in:
@ -260,6 +260,16 @@ named with its corresponding unit and with the `si::zeroth_degree_Celsius`
|
||||
|
||||
## Changes to units definitions
|
||||
|
||||
There were several known issues when units were deriving from each other
|
||||
(e.g., [#512](https://github.com/mpusz/mp-units/issues/512) and
|
||||
[#537](https://github.com/mpusz/mp-units/issues/537)). We could either highly complicate the
|
||||
framework to allow these which could result in much longer compilation times or disallow inheriting
|
||||
from units at all. We chose the second option.
|
||||
|
||||
With this release all of of the units must be marked as `final`. To enforce this we have changed
|
||||
the definition of the `Unit<T>` concept, which now requires type `T` to be `final`
|
||||
(:boom: **breaking change** :boom:).
|
||||
|
||||
[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
|
||||
@ -272,7 +282,7 @@ is why it was renamed to `symbol_text` (:boom: **breaking change** :boom:).
|
||||
=== "Now"
|
||||
|
||||
```cpp
|
||||
inline constexpr struct ohm : named_unit<symbol_text{u8"Ω", "ohm"}, volt / ampere> {} ohm;
|
||||
inline constexpr struct ohm final : named_unit<symbol_text{u8"Ω", "ohm"}, volt / ampere> {} ohm;
|
||||
```
|
||||
|
||||
=== "Before"
|
||||
@ -286,7 +296,7 @@ is why it was renamed to `symbol_text` (:boom: **breaking change** :boom:).
|
||||
On C++20-compliant compilers it should be enough to type the following in the unit's definition:
|
||||
|
||||
```cpp
|
||||
inline constexpr struct ohm : named_unit<{u8"Ω", "ohm"}, volt / ampere> {} ohm;
|
||||
inline constexpr struct ohm final : named_unit<{u8"Ω", "ohm"}, volt / ampere> {} ohm;
|
||||
```
|
||||
|
||||
## Improved text output
|
||||
@ -461,8 +471,8 @@ conversion factor. Here is a comparison of the code with previous and current de
|
||||
=== "Now"
|
||||
|
||||
```cpp
|
||||
inline constexpr struct yard : named_unit<"yd", mag_ratio<9'144, 10'000> * si::metre> {} yard;
|
||||
inline constexpr struct foot : named_unit<"ft", mag_ratio<1, 3> * yard> {} foot;
|
||||
inline constexpr struct yard final : named_unit<"yd", mag_ratio<9'144, 10'000> * si::metre> {} yard;
|
||||
inline constexpr struct foot final : named_unit<"ft", mag_ratio<1, 3> * yard> {} foot;
|
||||
```
|
||||
|
||||
=== "Before"
|
||||
|
Reference in New Issue
Block a user