@@ -251,6 +251,18 @@ Based on the same hierarchy of quantities of kind length, we can define quantity
251251 static_assert(implicitly_convertible(isq::radius, isq::length));
252252 ```
253253
254+ Implicit conversions are allowed on copy-initialization:
255+
256+ ```cpp
257+ void foo(quantity<isq::length[m]> q);
258+ ```
259+
260+ ```cpp
261+ quantity<isq::width[m]> q1 = 42 * m;
262+ quantity<isq::length[m]> q2 = q1; // implicit quantity conversion
263+ foo(q1); // implicit quantity conversion
264+ ```
265+
2542662 . ** Explicit conversions**
255267
256268 - not every _ length_ is a _ width_
@@ -265,6 +277,20 @@ Based on the same hierarchy of quantities of kind length, we can define quantity
265277 static_assert(explicitly_convertible(isq::length, isq::radius));
266278 ```
267279
280+ Explicit conversions are forced by passing the quantity to a call operator of a `quantity_spec`
281+ type or by calling `quantity`'s explicit constructor:
282+
283+ ```cpp
284+ void foo(quantity<isq::height[m]> q);
285+ ```
286+
287+ ```cpp
288+ quantity<isq::length[m]> q1 = 42 * m;
289+ quantity<isq::height[m]> q2 = isq::height(q1); // explicit quantity conversion
290+ quantity<isq::height[m]> q3(q1); // direct initialization
291+ foo(isq::height(q1)); // explicit quantity conversion
292+ ```
293+
2682943 . ** Explicit casts**
269295
270296 - _ height_ is not a _ width_
@@ -276,6 +302,18 @@ Based on the same hierarchy of quantities of kind length, we can define quantity
276302 static_assert(castable(isq::height, isq::width));
277303 ```
278304
305+ Explicit casts are forced with a dedicated `quantity_cast` function:
306+
307+ ```cpp
308+ void foo(quantity<isq::height[m]> q);
309+ ```
310+
311+ ```cpp
312+ quantity<isq::width[m]> q1 = 42 * m;
313+ quantity<isq::height[m]> q2 = quantity_cast<isq::height>(q1); // explicit quantity cast
314+ foo(quantity_cast<isq::height>(q1)); // explicit quantity cast
315+ ```
316+
2793174 . ** No conversion**
280318
281319 - _ time_ has nothing in common with _ length_
@@ -286,6 +324,17 @@ Based on the same hierarchy of quantities of kind length, we can define quantity
286324 static_assert(!castable(isq::time, isq::length));
287325 ```
288326
327+ Even the explicit casts will not force such a conversion:
328+
329+ ```cpp
330+ void foo(quantity<isq::length[m]>);
331+ ```
332+
333+ ```cpp
334+ quantity<isq::length[m]> q1 = 42 * s; // Compile-time error
335+ foo(quantity_cast<isq::length>(42 * s)); // Compile-time error
336+ ```
337+
289338
290339## Hierarchies of derived quantities
291340
0 commit comments