mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-01 03:14:29 +02:00
docs: get_kind()
note added to "Systems of Quantities" chapter
This commit is contained in:
@@ -392,4 +392,9 @@ static_assert(same_type<kind_of<isq::length> / isq::time, isq::length / isq::tim
|
||||
|
||||
Only a root quantity from the hierarchy tree or the one marked with `is_kind` specifier
|
||||
in the `quantity_spec` definition can be put as a template parameter to the `kind_of`
|
||||
specifier. For example, `kind_of<isq::width>` will fail to compile.
|
||||
specifier. For example, `kind_of<isq::width>` will fail to compile. However, we can call
|
||||
`get_kind(q)` to obtain a kind of any quantity:
|
||||
|
||||
```cpp
|
||||
static_assert(get_kind(isq::width) == kind_of<isq::length>);
|
||||
```
|
||||
|
Reference in New Issue
Block a user