diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index dd8b721c..17c92799 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -25,7 +25,7 @@ name: Documentation on: push: branches: - - master + - master - main permissions: contents: write @@ -37,7 +37,7 @@ jobs: - uses: actions/setup-python@v4 with: python-version: 3.x - - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV - uses: actions/cache@v3 with: key: mkdocs-material-${{ env.cache_id }} diff --git a/docs/.overrides/main.html b/docs/.overrides/main.html index 0d556b68..e4c38e21 100644 --- a/docs/.overrides/main.html +++ b/docs/.overrides/main.html @@ -5,4 +5,4 @@ You're not viewing the latest version. Click here to go to latest. -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/docs/getting_started/code_example.md b/docs/getting_started/code_example.md index e9445371..2d3f22da 100644 --- a/docs/getting_started/code_example.md +++ b/docs/getting_started/code_example.md @@ -28,7 +28,7 @@ static_assert(1000 / (1 * s) == 1 * kHz); ``` !!! example "[Try it on Compiler Explorer](https://godbolt.org/z/j8afKnarv)" - + This library requires some C++20 features ([concepts and constraints](https://en.cppreference.com/w/cpp/language/constraints), [classes as NTTP](https://en.cppreference.com/w/cpp/language/template_parameters), ...). Thanks to them, diff --git a/docs/getting_started/installation_and_usage.md b/docs/getting_started/installation_and_usage.md index 063fcbb4..1a5fe696 100644 --- a/docs/getting_started/installation_and_usage.md +++ b/docs/getting_started/installation_and_usage.md @@ -6,18 +6,18 @@ To achieve that, it extensively uses C++20 features and the [explicit object parameter](https://en.cppreference.com/w/cpp/language/member_functions#Explicit_object_parameter) from C++23. - + Even though the library benefits from C++23 (if available), C++20 is enough to compile and use all of the library's functionality. C++23 features are hidden behind a preprocessor macro providing a backward-compatible way to use it. - + Sadly, as of today, not many compilers provide full C++20 support. The library compiles fine on the following compilers (or newer): - + - gcc-12.2 In the upcoming weeks, we will be actively working to extend the support to other compilers as well. - + ## Repository Structure and Dependencies @@ -286,7 +286,7 @@ To obtain an official library release, the following steps may be performed: ```ini title="conanfile.txt" [requires] mp-units/0.8.0 - + [layout] cmake_layout diff --git a/docs/getting_started/quick_start.md b/docs/getting_started/quick_start.md index 50c121ed..6ca80ccc 100644 --- a/docs/getting_started/quick_start.md +++ b/docs/getting_started/quick_start.md @@ -73,4 +73,4 @@ auto speed = 60 * kmph; !!! note In case you wonder why this library does not use UDLs to create quantities, please check - our [FAQ](../faq/#why-dont-we-use-udls-to-create-quantities). \ No newline at end of file + our [FAQ](../faq/#why-dont-we-use-udls-to-create-quantities). diff --git a/docs/index.md b/docs/index.md index 67e4b0f8..f4f0c7c0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -19,14 +19,14 @@ The library source code is hosted on [GitHub](https://github.com/mpusz/mp-units) To achieve that, it extensively uses C++20 features and the [explicit object parameter](https://en.cppreference.com/w/cpp/language/member_functions#Explicit_object_parameter) from C++23. - + Even though the library benefits from C++23 (if available), C++20 is enough to compile and use all of the library's functionality. C++23 features are hidden behind a preprocessor macro providing a backward-compatible way to use it. - + Sadly, as of today, only a few compilers provide full C++20 support. The library compiles fine on the following compilers (or newer): - + - gcc-12.2 In the upcoming weeks, we will be actively working to extend the support to other compilers as well. diff --git a/docs/users_guide/simple_and_typed_quantities.md b/docs/users_guide/simple_and_typed_quantities.md index 70bd01bf..bcd8cfbd 100644 --- a/docs/users_guide/simple_and_typed_quantities.md +++ b/docs/users_guide/simple_and_typed_quantities.md @@ -185,22 +185,22 @@ Let's see another example: #include #include #include - + using namespace mp_units; - + class StorageTank { quantity base_; quantity height_; public: - constexpr StorageTank(const quantity& base, + constexpr StorageTank(const quantity& base, const quantity& height) : base_(base), height_(height) { } - + // ... }; - + class CylindricalStorageTank : public StorageTank { public: constexpr CylindricalStorageTank(const quantity& radius, @@ -209,7 +209,7 @@ Let's see another example: { } }; - + class RectangularStorageTank : public StorageTank { public: constexpr RectangularStorageTank(const quantity& length, @@ -219,7 +219,7 @@ Let's see another example: { } }; - + int main() { using namespace mp_units::si::unit_symbols; @@ -235,7 +235,7 @@ Let's see another example: #include #include #include - + using namespace mp_units; using namespace mp_units::si::unit_symbols; @@ -257,10 +257,10 @@ Let's see another example: base_(base), height_(height) { } - + // ... }; - + class CylindricalStorageTank : public StorageTank { public: constexpr CylindricalStorageTank(const quantity& radius, @@ -270,7 +270,7 @@ Let's see another example: { } }; - + class RectangularStorageTank : public StorageTank { public: constexpr RectangularStorageTank(const quantity& length, @@ -280,7 +280,7 @@ Let's see another example: { } }; - + int main() { auto tank = RectangularStorageTank(horizontal_length(1'000 * mm), diff --git a/test/unit_test/static/unit_symbol_test.cpp b/test/unit_test/static/unit_symbol_test.cpp index 599f6dc0..f1130610 100644 --- a/test/unit_test/static/unit_symbol_test.cpp +++ b/test/unit_test/static/unit_symbol_test.cpp @@ -145,7 +145,8 @@ static_assert(unit_symbol(kilogram * metre / square(second), {.solidus = always} static_assert(unit_symbol(kilogram * metre / square(second), {.encoding = ascii, .solidus = always}) == "kg m/s^2"); static_assert(unit_symbol(kilogram * metre / square(second), {.solidus = never}) == "kg m s⁻²"); static_assert(unit_symbol(kilogram * metre / square(second), {.encoding = ascii, .solidus = never}) == "kg m s^-2"); -static_assert(unit_symbol(kilogram * metre / square(second), {.solidus = never, .separator = half_high_dot}) == "kg⋅m⋅s⁻²"); +static_assert(unit_symbol(kilogram * metre / square(second), {.solidus = never, .separator = half_high_dot}) == + "kg⋅m⋅s⁻²"); static_assert(unit_symbol(kilogram / metre / square(second)) == "kg m⁻¹ s⁻²"); static_assert(unit_symbol(kilogram / metre / square(second), {.separator = half_high_dot}) == "kg⋅m⁻¹⋅s⁻²"); static_assert(unit_symbol(kilogram / metre / square(second), {.encoding = ascii}) == "kg m^-1 s^-2"); @@ -153,7 +154,8 @@ static_assert(unit_symbol(kilogram / metre / square(second), {.solidus = always} static_assert(unit_symbol(kilogram / metre / square(second), {.encoding = ascii, .solidus = always}) == "kg/(m s^2)"); static_assert(unit_symbol(kilogram / metre / square(second), {.solidus = never}) == "kg m⁻¹ s⁻²"); static_assert(unit_symbol(kilogram / metre / square(second), {.encoding = ascii, .solidus = never}) == "kg m^-1 s^-2"); -static_assert(unit_symbol(kilogram / metre / square(second), {.solidus = never, .separator = half_high_dot}) == "kg⋅m⁻¹⋅s⁻²"); +static_assert(unit_symbol(kilogram / metre / square(second), {.solidus = never, .separator = half_high_dot}) == + "kg⋅m⁻¹⋅s⁻²"); static_assert(unit_symbol(pow<123>(metre)) == "m¹²³"); static_assert(unit_symbol(pow<1, 2>(metre)) == "m^(1/2)"); static_assert(unit_symbol(pow<3, 5>(metre)) == "m^(3/5)");