diff --git a/docs/blog/posts/2.2.0-released.md b/docs/blog/posts/2.2.0-released.md index 53c6789e..2ea97e73 100644 --- a/docs/blog/posts/2.2.0-released.md +++ b/docs/blog/posts/2.2.0-released.md @@ -21,7 +21,7 @@ significant changes introduced by the new version can be found in our -## C++20 modules +## C++20 modules and project structure cleanup [GitHub Issue #7](https://github.com/mpusz/mp-units/issues/7) was our oldest open issue before this release. Not anymore. After 4.5 years, we finally closed it, even though @@ -90,9 +90,46 @@ In version 2.2, the following headers have a new location or contents: | _mp-units/systems/angular/math.h_ | `mp_units.systems` | Trigonometric functions using `angular::radian` | | _mp-units/systems/si/chrono.h_ | `mp_units.systems` | `std::chrono` compatibility traits | +Benefiting from this opportunity, we also cleaned up core and systems definitions +(:boom: **breaking change** :boom:). + +Regarding the library's core, we exposed only one header `framework.h` that exposes all of +the library's framework so the user does not have to enumerate files like `unit.h`, `quantity.h`, +and `quantity_point.h` anymore. Those headers are not gone, they were put to +the `mp-units/framework` subheader. So they are still there if you really need them. + +Regarding the changes in systems definitions, we moved the wrapper header files with the entire +system definition to the `mp-units/systems` subdirectory. Additionally, they now also include +`framework.h`, so a system include is enough to use the library. Thanks to that our users don't +have to write tedious code like the below anymore: + +=== "Now" + + ```cpp + #include + #include + #include + #include + + // ... + ``` + +=== "Before" + + ```cpp + #include + #include + #include + #include + #include + + // ... + ``` + Additionally, we merged all of the compatibility-related macros into one header file -_mp-units/compat_macros.h_. This header file should be explicitly included before importing C++ -modules if we want to benefit from the [Wide Compatibility tools](../../users_guide/use_cases/wide_compatibility.md). +`mp-units/compat_macros.h`. This header file should be explicitly included before importing C++ +modules if we want to benefit from the +[Wide Compatibility tools](../../users_guide/use_cases/wide_compatibility.md). ## Better control over the library's API @@ -383,13 +420,13 @@ Also, the header itself was split into smaller pieces that improve C++20 modules ## `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 interfaces in the public part of the library (: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. -Alternatively, we introduced a new helper called `mag_ratio` to provide the magnitude of the unit -defined in terms of a rational conversion factor. Here is a comparison of the code with previous -and current definitions: +Alternatively, as in the public interface it was always only used with `mag`, we introduced a new +helper called `mag_ratio` to provide the magnitude of the unit defined in terms of a rational +conversion factor. Here is a comparison of the code with previous and current definitions: === "Now"