docs: "Quantity points" chapter extended

This commit is contained in:
Mateusz Pusz
2023-12-21 12:23:52 +01:00
parent ed2b91500a
commit a114b9b9a3

View File

@ -85,8 +85,14 @@ static_assert(140 * km / (2 * h) == 70 * km / h);
## Quantity points ## Quantity points
The `quantity_point` class template specifies an absolute quantity with respect to an origin. The quantity point specifies an absolute quantity with respect to an origin.
Together with quantities they model [The Affine Space](../users_guide/framework_basics/the_affine_space.md). Together with quantities, they model [The Affine Space](../users_guide/framework_basics/the_affine_space.md).
Quantity points should be used in all places where adding two values is meaningless
(e.g., temperature points, timestamps, altitudes, readouts from the car's odometer, etc.).
The set of operations that can be done on quantity points is limited compared to quantities.
This introduces an additional type-safety.
```cpp ```cpp
#include <mp-units/ostream.h> #include <mp-units/ostream.h>
@ -112,3 +118,8 @@ The above outputs:
```text ```text
Temperature: 20 °C (68 °F) Temperature: 20 °C (68 °F)
``` ```
!!! info
Check [The Affine Space](../users_guide/framework_basics/the_affine_space.md) chapter to learn
more about quantity points.