diff --git a/docs/users_guide/framework_basics/systems_of_units.md b/docs/users_guide/framework_basics/systems_of_units.md index df37b6bf..307fd215 100644 --- a/docs/users_guide/framework_basics/systems_of_units.md +++ b/docs/users_guide/framework_basics/systems_of_units.md @@ -190,3 +190,21 @@ inline constexpr struct mag_pi final : magnitude ```cpp inline constexpr struct degree final : named_unit<{u8"°", "deg"}, mag_pi / mag<180> * si::radian> {} degree; ``` + +!!! tip + + The ISO 8000 and [SI](../../appendix/glossary.md#si) standards explicitly forbid using prefixes + with some units (e.g., day, minute, hour, degree Celsius). This is why the library disallows + this as well by providing specializations of the `unit_can_be_prefixed` variable template for + such units. Thanks to it trying to create a prefixed version for them will result in + a compile-time error. + + However, some projects are not aware of those limitations and use prefixed version of such units + (e.g., [linux kernel uses millidegrees Celsius](https://github.com/search?q=repo%3Atorvalds%2Flinux+millidegree&type=code)). + To enable compatibility with those projects we can workaround the limitation in **mp-units** + by providing a scaled version of the unit explicitly: + + ```cpp + inline constexpr struct milli_degree_celsius final : named_unit * si::degree_Celsius> {} milli_degree_celsius; + inline constexpr auto mdeg_C = milli_degree_celsius; + ```