mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-01 03:14:29 +02:00
docs: emojis added to the "breaking change" statements
This commit is contained in:
@@ -45,7 +45,7 @@ quantity q5 = 60 * km / h;
|
|||||||
quantity q6 = 50 / s;
|
quantity q6 = 50 / s;
|
||||||
```
|
```
|
||||||
|
|
||||||
As a side effect, we introduced a **breaking change**. We can't use the following definition of
|
As a side effect, we introduced a :boom: **breaking change** :boom:. We can't use the following definition of
|
||||||
hertz anymore:
|
hertz anymore:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
@@ -91,7 +91,8 @@ In the initial version of the V2 framework, if someone did not like the multiply
|
|||||||
a `quantity` we provided the `make_quantity()` factory function. A similar approach was used for
|
a `quantity` we provided the `make_quantity()` factory function. A similar approach was used for
|
||||||
`quantity_point` creation.
|
`quantity_point` creation.
|
||||||
|
|
||||||
This version removes those (**breaking change**) and introduces two parameter constructors:
|
This version removes those (:boom: **breaking change** :boom:) and introduces two parameter
|
||||||
|
constructors:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
quantity q(42, si::metre);
|
quantity q(42, si::metre);
|
||||||
@@ -119,7 +120,7 @@ quantity<si::sievert> q2 = 42 * Gy;
|
|||||||
Another significant improvement in this version was redesigning the way we provide compatibility
|
Another significant improvement in this version was redesigning the way we provide compatibility
|
||||||
with other similar libraries. The interfaces of `quantity_like_traits` and `quantity_point_like_traits`
|
with other similar libraries. The interfaces of `quantity_like_traits` and `quantity_point_like_traits`
|
||||||
were changed and extended to provide conversion not only from but also to entities from other
|
were changed and extended to provide conversion not only from but also to entities from other
|
||||||
libraries (**breaking change**).
|
libraries (:boom: **breaking change** :boom:).
|
||||||
|
|
||||||
We've also introduced an innovative approach that allows us to specify if such conversions should
|
We've also introduced an innovative approach that allows us to specify if such conversions should
|
||||||
happen implicitly or if they need to be forced explicitly.
|
happen implicitly or if they need to be forced explicitly.
|
||||||
@@ -151,7 +152,7 @@ inline constexpr struct ice_point : relative_point_origin<absolute_zero + 273.15
|
|||||||
inline constexpr struct zeroth_degree_Celsius : decltype(ice_point) {} zeroth_degree_Celsius;
|
inline constexpr struct zeroth_degree_Celsius : decltype(ice_point) {} zeroth_degree_Celsius;
|
||||||
```
|
```
|
||||||
|
|
||||||
Please note that this is a **breaking change** as well.
|
Please note that this is a :boom: **breaking change** :boom: as well.
|
||||||
|
|
||||||
|
|
||||||
## Unit symbol text can now be properly used at runtime
|
## Unit symbol text can now be properly used at runtime
|
||||||
@@ -159,7 +160,7 @@ Please note that this is a **breaking change** as well.
|
|||||||
The interface of the previous definition of `unit_symbol` function allowed the use of the returned
|
The interface of the previous definition of `unit_symbol` function allowed the use of the returned
|
||||||
buffer only at compile-time. This was too limiting as users often want to use unit symbols at
|
buffer only at compile-time. This was too limiting as users often want to use unit symbols at
|
||||||
runtime (e.g., print them to the console). The new version redesigned the interface of this
|
runtime (e.g., print them to the console). The new version redesigned the interface of this
|
||||||
function (**breaking change**) to return a buffer that can be properly used at both compilation and
|
function (:boom: **breaking change** :boom:) to return a buffer that can be properly used at both compilation and
|
||||||
runtime:
|
runtime:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
|
@@ -64,9 +64,9 @@ flowchart TD
|
|||||||
The easiest way to use them is just to `import mp_units;` at the beginning of your translation unit
|
The easiest way to use them is just to `import mp_units;` at the beginning of your translation unit
|
||||||
(see the [Quick Start](../../getting_started/quick_start.md) chapter for some usage examples).
|
(see the [Quick Start](../../getting_started/quick_start.md) chapter for some usage examples).
|
||||||
|
|
||||||
In this release, we also highly limited the number of CMake targets (**breaking change**). Now, they
|
In this release, we also highly limited the number of CMake targets (:boom: **breaking change** :boom:).
|
||||||
correspond exactly to the C++ modules they provide. This means that many smaller partial targets
|
Now, they correspond exactly to the C++ modules they provide. This means that many smaller partial
|
||||||
were removed. We also merged text output targets with the core library's definition.
|
targets were removed. We also merged text output targets with the core library's definition.
|
||||||
|
|
||||||
The table below specifies where we can now find the contents of previously available CMake targets:
|
The table below specifies where we can now find the contents of previously available CMake targets:
|
||||||
|
|
||||||
@@ -78,8 +78,8 @@ The table below specifies where we can now find the contents of previously avail
|
|||||||
| `mp-units::{system_name}` | `mp-units::systems` |
|
| `mp-units::{system_name}` | `mp-units::systems` |
|
||||||
|
|
||||||
While we were enabling C++ modules, we also had to refactor our header files slightly
|
While we were enabling C++ modules, we also had to refactor our header files slightly
|
||||||
(**breaking change**). Some had to be split into smaller pieces (e.g., _math.h_), while
|
(:boom: **breaking change** :boom:). Some had to be split into smaller pieces (e.g., _math.h_),
|
||||||
others had to be moved to a different subdirectory (e.g., _chrono.h_).
|
while others had to be moved to a different subdirectory (e.g., _chrono.h_).
|
||||||
|
|
||||||
In version 2.2, the following headers have a new location or contents:
|
In version 2.2, the following headers have a new location or contents:
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ three values:
|
|||||||
- `Auto` - The feature is automatically enabled if the compiler supports it (old behavior).
|
- `Auto` - The feature is automatically enabled if the compiler supports it (old behavior).
|
||||||
|
|
||||||
Additionally, some CMake options were renamed to better express the impact on our users
|
Additionally, some CMake options were renamed to better express the impact on our users
|
||||||
(**breaking change**). For example, now CMake options include:
|
(:boom: **breaking change** :boom:). For example, now CMake options include:
|
||||||
|
|
||||||
- `MP_UNITS_API_*` - options affecting the library's API,
|
- `MP_UNITS_API_*` - options affecting the library's API,
|
||||||
- `MP_UNITS_BUILD_*` - options affecting the build process,
|
- `MP_UNITS_BUILD_*` - options affecting the build process,
|
||||||
@@ -197,16 +197,17 @@ By omission, we had the following temperature point origins in the library:
|
|||||||
- `usc::zero_Fahrenheit` (for `usc::degree_Fahrenheit`).
|
- `usc::zero_Fahrenheit` (for `usc::degree_Fahrenheit`).
|
||||||
|
|
||||||
With this release, the last one was renamed to `usc::zeroth_degree_Fahrenheit` to be consistently
|
With this release, the last one was renamed to `usc::zeroth_degree_Fahrenheit` to be consistently
|
||||||
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`
|
||||||
|
(:boom: **breaking change** :boom:).
|
||||||
|
|
||||||
|
|
||||||
## Changes to units definitions
|
## Changes to units definitions
|
||||||
|
|
||||||
[WG21 Study Group 16 (Unicode) raised concerns](https://github.com/sg16-unicode/sg16-meetings#january-24th-2024)
|
[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
|
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
|
literal encodings. Those issues were resolved with a change to units definitions
|
||||||
change**). It affects only units that specify both Unicode and ASCII symbols. The new design
|
(:boom: **breaking change** :boom:). It affects only units that specify both Unicode and ASCII
|
||||||
requires the Unicode symbol to be provided as a UTF-8 literal:
|
symbols. The new design requires the Unicode symbol to be provided as a UTF-8 literal:
|
||||||
|
|
||||||
=== "Now"
|
=== "Now"
|
||||||
|
|
||||||
@@ -227,10 +228,11 @@ With this release, we can print not only whole quantities but also just their un
|
|||||||
Also, we fixed the `std::format` support so users can now enjoy full C++20 compatibility and
|
Also, we fixed the `std::format` support so users can now enjoy full C++20 compatibility and
|
||||||
don't have to use [fmtlib](https://github.com/fmtlib/fmt) anymore.
|
don't have to use [fmtlib](https://github.com/fmtlib/fmt) anymore.
|
||||||
|
|
||||||
We have also changed the grammar for quantities formatting (**breaking change**). It introduces
|
We have also changed the grammar for quantities formatting (:boom: **breaking change** :boom:).
|
||||||
the composition of underlying formatters that finally allows us to properly format user-defined
|
It introduces the composition of underlying formatters that finally allows us to properly format
|
||||||
representation types (assuming they have `std::format` support). Additionally, thanks to a
|
user-defined representation types (assuming they have `std::format` support). Additionally, thanks
|
||||||
new `%?` token, we can provide a custom format string that will properly print quantity of any unit.
|
to a new `%?` token, we can provide a custom format string that will properly print quantity of
|
||||||
|
any unit.
|
||||||
|
|
||||||
Here is a small preview of what is now available:
|
Here is a small preview of what is now available:
|
||||||
|
|
||||||
@@ -369,7 +371,7 @@ First, `fma`, `isfinite`, `isinf`, and `isnan` math function were added by
|
|||||||
|
|
||||||
Additionally, we changed the namespace for trigonometric functions using SI units. Now they are
|
Additionally, we changed the namespace for trigonometric functions using SI units. Now they are
|
||||||
inside of the `mp_units::si` subnamespace and not in `mp_units::isq` like it was the case before
|
inside of the `mp_units::si` subnamespace and not in `mp_units::isq` like it was the case before
|
||||||
(**breaking change**).
|
(:boom: **breaking change** :boom:).
|
||||||
|
|
||||||
Also, the header itself was split into smaller pieces that improve C++20 modules definitions.
|
Also, the header itself was split into smaller pieces that improve C++20 modules definitions.
|
||||||
|
|
||||||
@@ -377,7 +379,7 @@ Also, the header itself was split into smaller pieces that improve C++20 modules
|
|||||||
## `ratio` made an implementation detail of the library
|
## `ratio` made an implementation detail of the library
|
||||||
|
|
||||||
We decided not to expose `ratio` and associated types in the public interface of the library
|
We decided not to expose `ratio` and associated types in the public interface of the library
|
||||||
(**breaking change**). Standardization of it could be problematic as we have
|
(:boom: **breaking change** :boom:). Standardization of it could be problematic as we have
|
||||||
[`std::ratio`](https://en.cppreference.com/w/cpp/numeric/ratio/ratio) already.
|
[`std::ratio`](https://en.cppreference.com/w/cpp/numeric/ratio/ratio) already.
|
||||||
|
|
||||||
Alternatively, we introduced a new helper called `mag_ratio` to provide the magnitude of the unit
|
Alternatively, we introduced a new helper called `mag_ratio` to provide the magnitude of the unit
|
||||||
|
Reference in New Issue
Block a user