Skip to content

Commit 142beaa

Browse files
committed
docs: "Quantity Kind Safety" now uses absorbed dose and dose equivalent
1 parent bc437c1 commit 142beaa

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/getting_started/safety_features.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,26 +125,26 @@ by `std::chrono::duration`) and compile-time scaling overflow detection.
125125
represent different physical concepts.
126126

127127
```cpp
128-
quantity<si::radian> plane_angle = 1.5 * rad;
129-
quantity<si::steradian> solid_angle = 2.0 * sr;
128+
quantity absorbed_dose = 1.5 * Gy;
129+
quantity dose_equivalent = 2.0 * Sv;
130130

131-
// auto result = plane_angle + solid_angle; // ❌ Compile-time error!
132-
// Error: cannot add plane angle and solid angle (both dimensionless, but different kinds)
131+
// auto result = absorbed_dose + dose_equivalent; // ❌ Compile-time error!
132+
// Error: cannot add absorbed dose and dose equivalent (both L²T⁻², but different kinds)
133133

134-
// QuantityOf<isq::angular_measure> auto alpha = 2.5 * sr; // ❌ Compile-time error!
135-
// Error: cannot initialize plane angle with solid angle (different quantity kinds)
134+
// QuantityOf<isq::absorbed_dose> auto d = 2.5 * Sv; // ❌ Compile-time error!
135+
// Error: cannot initialize absorbed dose with dose equivalent (different quantity kinds)
136136
```
137137

138138
Examples of quantities with same dimension but different kinds:
139139

140-
- **Frequency (Hz)** and **Activity (Bq)**: Both `1/time`
141140
- **Absorbed dose (Gy)** and **Dose equivalent (Sv)**: Both `length²/time²`
141+
- **Frequency (Hz)** and **Activity (Bq)**: Both `1/time`
142142
- **Plane angle (rad)** and **Solid angle (sr)**: Both dimensionless
143143

144144
!!! important
145145

146146
**mp-units is the only C++ library implementing quantity kind safety.** It fully
147-
distinguishes all SI quantity kinds including Hz/Bq, rad/sr, and Gy/Sv.
147+
distinguishes all SI quantity kinds including Gy/Sv, Hz/Bq, and rad/sr.
148148

149149

150150
## Quantity Safety

0 commit comments

Comments
 (0)