|
18 | 18 |
|
19 | 19 | # `mp-units` – The Quantities and Units Library for C++ |
20 | 20 |
|
21 | | -> 🚀 **ISO C++29 Standardization Candidate** – The future of dimensional analysis in C++! |
22 | | -
|
23 | | -**The `mp-units` library is a candidate for ISO standardization for C++29.** |
24 | | -More context can be found in the following ISO C++ proposals: |
25 | | - |
26 | | -- [P1935: A C++ Approach to Physical Units](https://wg21.link/p1935) |
27 | | -- [P2980: A motivation, scope, and plan for a quantities and units library](https://wg21.link/p2980) |
28 | | -- [P3045: Quantities and units library](https://wg21.link/p3045) |
29 | | - |
30 | | -> 🤝 **We are actively seeking organizations and individuals interested in** |
31 | | -> **field‑trialing the library!** |
32 | | -
|
33 | | - |
34 | | -## 🌟 Share Your Success Story |
35 | | - |
36 | | -**Help shape the future of C++!** |
37 | | -Your testimonials help **demonstrate real-world value** to the ISO C++ Committee and |
38 | | -other potential library users! |
39 | | - |
40 | | -Whether you're using mp-units in **production**, **research**, or **education**: |
41 | | - |
42 | | -- **Organizations**: Share your production deployments and success stories |
43 | | -- **Academics**: Report research applications and teaching experiences |
44 | | -- **Developers**: Tell us about your innovative use cases and benefits |
45 | | - |
46 | | -[](https://github.com/mpusz/mp-units/issues/new?template=usage_experience.yml) |
47 | 21 |
|
| 22 | +## ⚡ TL;DR |
48 | 23 |
|
49 | | -## 📚 Documentation |
| 24 | +**`mp-units`** is the only Modern C++ (C++20 and later) library providing the full |
| 25 | +spectrum of compile‑time safety for physical quantities and units — from dimensional |
| 26 | +analysis to quantity kind safety — built on the ISO 80000 International System of |
| 27 | +Quantities (ISQ). |
50 | 28 |
|
51 | | -Extensive project documentation is available on the **[project site](https://mpusz.github.io/mp-units)**. |
52 | | -It includes: |
| 29 | +### What Sets mp-units Apart? |
53 | 30 |
|
54 | | -- **Installation instructions** – Get up and running quickly |
55 | | -- **Detailed user's guide** – Comprehensive usage documentation |
56 | | -- **Design rationale** – Understanding the architectural decisions |
57 | | -- **API reference** – Complete technical documentation |
58 | | -- **Tutorials** – Step-by-step learning resources |
59 | | -- **Workshops** – Hands-on practice exercises |
60 | | -- **Examples** – Real-world usage demonstrations |
| 31 | +Beyond standard dimensional analysis and automatic unit converions, **mp-units** provides |
| 32 | +safety levels available in no other C++ library: |
61 | 33 |
|
| 34 | +- 🥇 **The only C++ library with Quantity Kind Safety** — Distinguishes quantities that |
| 35 | + share the same dimension but represent fundamentally different physical concepts: |
| 36 | + _frequency_ (Hz) ≠ _radioactive activity_ (Bq), _absorbed dose_ (Gy) ≠ _dose equivalent_ |
| 37 | + (Sv), _plane angle_ (rad) ≠ _solid angle_ (sr). Dimensional analysis alone cannot catch |
| 38 | + these errors — **mp-units** prevents them at compile time. |
62 | 39 |
|
63 | | -## ⚡ TL;DR |
| 40 | +- 🥇 **The only library implementing ISO 80000 (ISQ)** — Built on the International System |
| 41 | + of Quantities, functions can require _specific_ quantities: `isq::height` (not just any |
| 42 | + `isq::length`), `isq::kinetic_energy` (not just any `isq::energy`). The physics of your |
| 43 | + domain becomes part of the type system. |
64 | 44 |
|
65 | | -**`mp-units`** is a Modern C++ (C++20 and later) library providing compile‑time |
66 | | -dimensional analysis and safe manipulation of units, quantities, and quantity points. |
| 45 | +- 🥇 **Strongly-Typed Numerics for Any Domain** — The quantity framework extends beyond |
| 46 | + physics: define semantically distinct types for item counts, financial values, identifiers, |
| 47 | + or any numeric abstraction that should never be silently mixed at compile time. |
67 | 48 |
|
68 | 49 | ### Key Features |
69 | 50 |
|
70 | 51 | - **Type Safety** – Strongly typed quantities, units, dimensions, and quantity points |
71 | 52 | - **Zero Runtime Cost** – Compile‑time dimensional analysis with no runtime overhead |
72 | 53 | - **Unified Design** – Comprehensive model for units, dimensions, quantities, and point origins |
| 54 | +- **ISO 80000 / ISQ Hierarchy** – Implements the International System of Quantities (ISQ) |
| 55 | + with physics‑correct quantity types and hierarchies |
| 56 | +- **Quantity Kind Safety** – Distinguishes physically distinct concepts sharing the same |
| 57 | + dimension (e.g., Hz vs. Bq, Gy vs. Sv, rad vs. sr) |
73 | 58 | - **Rich Text Formatting** – Text formatting support with extensive options & |
74 | 59 | character sets |
75 | 60 | - **Flexible Usage** – C++ modules support (when available) and header‑only usage |
@@ -160,6 +145,50 @@ int main() |
160 | 145 | [](https://godbolt.org/z/rYq7cfdxY) |
161 | 146 |
|
162 | 147 |
|
| 148 | +## 🚀 ISO C++29 Standardization Candidate |
| 149 | + |
| 150 | +> The future of dimensional analysis in C++! |
| 151 | + |
| 152 | +**The `mp-units` library is a candidate for ISO standardization for C++29.** |
| 153 | +More context can be found in the following ISO C++ proposals: |
| 154 | + |
| 155 | +- [P1935: A C++ Approach to Physical Units](https://wg21.link/p1935) |
| 156 | +- [P2980: A motivation, scope, and plan for a quantities and units library](https://wg21.link/p2980) |
| 157 | +- [P3045: Quantities and units library](https://wg21.link/p3045) |
| 158 | + |
| 159 | +> 🤝 **We are actively seeking organizations and individuals interested in** |
| 160 | +> **field‑trialing the library!** |
| 161 | + |
| 162 | + |
| 163 | +## 🌟 Share Your Success Story |
| 164 | + |
| 165 | +**Help shape the future of C++!** |
| 166 | +Your testimonials help **demonstrate real-world value** to the ISO C++ Committee and |
| 167 | +other potential library users! |
| 168 | + |
| 169 | +Whether you're using mp-units in **production**, **research**, or **education**: |
| 170 | +
|
| 171 | +- **Organizations**: Share your production deployments and success stories |
| 172 | +- **Academics**: Report research applications and teaching experiences |
| 173 | +- **Developers**: Tell us about your innovative use cases and benefits |
| 174 | +
|
| 175 | +[](https://github.com/mpusz/mp-units/issues/new?template=usage_experience.yml) |
| 176 | +
|
| 177 | +
|
| 178 | +## 📚 Documentation |
| 179 | +
|
| 180 | +Extensive project documentation is available on the **[project site](https://mpusz.github.io/mp-units)**. |
| 181 | +It includes: |
| 182 | +
|
| 183 | +- **Installation instructions** – Get up and running quickly |
| 184 | +- **Detailed user's guide** – Comprehensive usage documentation |
| 185 | +- **Design rationale** – Understanding the architectural decisions |
| 186 | +- **API reference** – Complete technical documentation |
| 187 | +- **Tutorials** – Step-by-step learning resources |
| 188 | +- **Workshops** – Hands-on practice exercises |
| 189 | +- **Examples** – Real-world usage demonstrations |
| 190 | + |
| 191 | + |
163 | 192 | ## 🔍 Try It Out |
164 | 193 |
|
165 | 194 | ### Compiler Explorer |
|
0 commit comments