docs: Quantity Kinds docs fixed

Fixes #204
This commit is contained in:
Mateusz Pusz
2021-02-15 20:38:24 +01:00
parent 29d40f42ef
commit a8fccf0cb5
2 changed files with 10 additions and 9 deletions

View File

@@ -14,6 +14,7 @@ Framework Basics
framework/basic_concepts framework/basic_concepts
framework/quantities framework/quantities
framework/quantity_points framework/quantity_points
framework/quantity_kinds
framework/dimensions framework/dimensions
framework/units framework/units
framework/constants framework/constants

View File

@@ -12,7 +12,7 @@ It is represented in the library with a `quantity_kind` class template.
Kind creation Kind creation
------------- -------------
We need a `kind` to represent the more specific usage of a quantity. We need a `kind` to represent the more specific usage of a quantity::
struct radius : kind<radius, si::dim_length> {}; struct radius : kind<radius, si::dim_length> {};
@@ -46,11 +46,11 @@ Differences to quantity
Unlike `quantity`, the library provides: Unlike `quantity`, the library provides:
- no kinds, such as ``radius`` or ``width``, therefore - no kinds, such as ``radius`` or ``width``, therefore
* no UDLs or unit constants, * no UDLs or unit constants,
* no kind-specific concepts, such as ``Radius``, * no kind-specific concepts, such as ``Radius``,
(there's the generic `QuantityKind` and kind-specifiable `QuantityKindOf`), (there's the generic `QuantityKind` and kind-specifiable `QuantityKindOf`),
- a slightly different set of operations on quantity kinds - a slightly different set of operations on quantity kinds
(see the :ref:`Dimensions` chapter) (see the :ref:`Dimensions` chapter).
Quantity point kind Quantity point kind
------------------- -------------------
@@ -60,13 +60,13 @@ A quantity point kind is the analogous of a quantity point for quantity kinds.
They are represented in the library with a `quantity_point_kind` class template. They are represented in the library with a `quantity_point_kind` class template.
First, we need a `point_kind` for a `kind`. First, we need a `point_kind` for a `kind`::
struct width : kind<width, si::dim_length> {}; struct width : kind<width, si::dim_length> {};
struct x_coordinate : point_kind<x_coordinate, width> {}; struct x_coordinate : point_kind<x_coordinate, width> {};
Now x coordinates can be constructed: Now ``x`` coordinates can be constructed::
quantity_point_kind<x_coordinate, si::metre, int> auto x_pos(123 * m); quantity_point_kind<x_coordinate, si::metre, int> auto x_pos(123 * m);
// `QuantityPointKindOf<x_coordinate>` with `x_pos.relative()` // `QuantityPointKindOf<x_coordinate>` with `x_pos.relative()`
// equal to `quantity_kind<width, si::metre, int>(123 * m)` // equal to `quantity_kind<width, si::metre, int>(123 * m)`