From 9f50a0fc550972fd34823f58717cf01fad08f16e Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Mon, 16 Jun 2025 22:19:42 +0200 Subject: [PATCH] docs: `relative_point_origin` added to the absolute quantities blog post --- docs/blog/posts/introducing-absolute-quantities.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/blog/posts/introducing-absolute-quantities.md b/docs/blog/posts/introducing-absolute-quantities.md index f2e33e74..a651b960 100644 --- a/docs/blog/posts/introducing-absolute-quantities.md +++ b/docs/blog/posts/introducing-absolute-quantities.md @@ -135,9 +135,13 @@ will not need any specifier to denote them. For example: ```cpp -quantity> m1(10 * kg); // point quantity with an implicit point origin -quantity        m2 = 15 * kg; // absolute quantity (e.g., non-negative) -quantity> m3 = m1 - m2; // delta quantity (e.g., may be negative) +inline constexpr struct tare final : relative_point_origin {} tare; + +quantity> m1(10 * kg); // point quantity with an implicit point origin +quantity> m2 = tare + 8 * kg; // point quantity with an explicit relative point origin +quantity        m3 = 15 * kg; // absolute quantity (e.g., non-negative) +quantity> m13 = m1 - m3; // delta quantity (e.g., may be negative) +quantity> m23 = m2 - m3; // delta quantity (e.g., may be negative) ``` With the above, the previous examples may be refactored to: