docs: relative_point_origin added to the absolute quantities blog post

This commit is contained in:
Mateusz Pusz
2025-06-16 22:19:42 +02:00
parent 30ded684e2
commit 9f50a0fc55

View File

@ -135,9 +135,13 @@ will not need any specifier to denote them.
For example:
```cpp
quantity<point<isq::mass>> m1(10 * kg); // point quantity with an implicit point origin
quantity<isq::mass>        m2 = 15 * kg; // absolute quantity (e.g., non-negative)
quantity<delta<isq::mass>> m3 = m1 - m2; // delta quantity (e.g., may be negative)
inline constexpr struct tare final : relative_point_origin<quantity_point{2 * kg}> {} tare;
quantity<point<isq::mass>> m1(10 * kg); // point quantity with an implicit point origin
quantity<point<isq::mass>> m2 = tare + 8 * kg; // point quantity with an explicit relative point origin
quantity<isq::mass>        m3 = 15 * kg; // absolute quantity (e.g., non-negative)
quantity<delta<isq::mass>> m13 = m1 - m3; // delta quantity (e.g., may be negative)
quantity<delta<isq::mass>> m23 = m2 - m3; // delta quantity (e.g., may be negative)
```
With the above, the previous examples may be refactored to: