forked from mpusz/mp-units
docs: admonition types usage fine tuned
This commit is contained in:
@@ -137,7 +137,7 @@ including:
|
||||
`QuantitySpecOf` concept is satisfied when both arguments satisfy a [`QuantitySpec`](#QuantitySpec) concept
|
||||
and when `T` is implicitly convertible to `V`.
|
||||
|
||||
??? note "More details"
|
||||
??? info "More details"
|
||||
|
||||
Additionally:
|
||||
|
||||
@@ -253,7 +253,7 @@ units can be passed as an argument to a `prefixed_unit` class template.
|
||||
`UnitOf` concept is satisfied for all units `T` matching an [`AssociatedUnit`](#AssociatedUnit)
|
||||
concept with an associated quantity type implicitly convertible to `V`.
|
||||
|
||||
??? note "More details"
|
||||
??? info "More details"
|
||||
|
||||
Additionally, the kind of `V` and the kind of quantity type associated with `T` must be the same,
|
||||
or the quantity type associated with `T` may not be derived from the kind of `V`.
|
||||
|
||||
@@ -138,7 +138,7 @@ quantities deriving from them.
|
||||
As we observed above, the most common unit for dimensionless quantities is `one`. It has the
|
||||
ratio of `1` and does not output any textual symbol.
|
||||
|
||||
!!! note
|
||||
!!! important
|
||||
|
||||
A unit `one` is special in the entire type system of units as it is considered to be
|
||||
[an identity operand in the unit expression templates](interface_introduction.md#identities).
|
||||
|
||||
@@ -16,7 +16,7 @@ behind this is that:
|
||||
- Users always work with objects and never have to spell such a type name.
|
||||
- The types appear in the compilation errors and during debugging.
|
||||
|
||||
!!! info
|
||||
!!! important
|
||||
|
||||
To improve compiler errors' readability and make it easier to correlate them with
|
||||
a user's written code, a new idiom in the library is to use the same identifier for
|
||||
@@ -133,7 +133,7 @@ type = class mp_units::quantity<mp_units::derived_unit<metre, mp_units::per<seco
|
||||
|
||||
The same type identifier will be visible in the compilation error (in case it happens).
|
||||
|
||||
!!! info
|
||||
!!! important
|
||||
|
||||
Expressions templates are extensively used throughout the library to improve the readability
|
||||
of the resulting types.
|
||||
|
||||
@@ -27,7 +27,7 @@ The concept `Reference` is satisfied by either:
|
||||
- a unit with an associated quantity type (i.e. `si::metre`)
|
||||
- a reference type explicitly specifying the quantity type and its unit.
|
||||
|
||||
!!! note
|
||||
!!! important
|
||||
|
||||
All units in the SI system have an associated quantity type.
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ All of those quantities have the same dimension, namely $\mathsf{T}^{-1}$, but p
|
||||
is not wise to allow adding, subtracting, or comparing them, as they describe vastly different
|
||||
physical properties.
|
||||
|
||||
!!! info
|
||||
!!! important
|
||||
|
||||
More than one quantity may be defined for the same dimension:
|
||||
|
||||
@@ -354,7 +354,7 @@ To annotate a quantity to represent its kind (and not just a hierarchy tree's ro
|
||||
we introduced a `kind_of<>` specifier. For example, to express any quantity of length, we need
|
||||
to type `kind_of<isq::length>`.
|
||||
|
||||
!!! note
|
||||
!!! important
|
||||
|
||||
`isq::length` and `kind_of<isq::length>` are two different things.
|
||||
|
||||
@@ -380,7 +380,7 @@ static_assert(!same_type<kind_of<isq::length> / isq::time, kind_of<isq::length /
|
||||
static_assert(same_type<kind_of<isq::length> / isq::time, isq::length / isq::time>);
|
||||
```
|
||||
|
||||
!!! note
|
||||
!!! info
|
||||
|
||||
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`
|
||||
|
||||
@@ -29,7 +29,7 @@ previous chapter) with a unit that is used to express it:
|
||||
inline constexpr struct metre : named_unit<"m", kind_of<isq::length>> {} metre;
|
||||
```
|
||||
|
||||
!!! note
|
||||
!!! important
|
||||
|
||||
The `kind_of<isq::length>` above states explicitly that this unit has
|
||||
an associated quantity kind. In other words, `si::metre` (and scaled units based
|
||||
|
||||
@@ -37,7 +37,7 @@ The text output will always print the [value of a quantity](../../appendix/gloss
|
||||
typically followed by a space and then the symbol of a [unit](../../appendix/glossary.md#unit)
|
||||
associated with this quantity.
|
||||
|
||||
!!! note
|
||||
!!! important
|
||||
|
||||
Remember that when we deal with a quantity of an "unknown" `auto` type, it is a good practice
|
||||
to always [convert the unit to the expected one](value_conversions.md#value-conversions)
|
||||
|
||||
@@ -29,7 +29,7 @@ Here are the primary operations one can do in the affine space:
|
||||
- _vector_ + _point_ -> _point_
|
||||
- _point_ - _vector_ -> _point_
|
||||
|
||||
!!! note
|
||||
!!! important
|
||||
|
||||
It is not possible to:
|
||||
|
||||
@@ -337,7 +337,7 @@ The following operations are not allowed in the affine space:
|
||||
- How to subtract a point on our trip to CppCon measured relatively to our home location from
|
||||
a point measured relative to the center of the Solar System?
|
||||
|
||||
!!! note
|
||||
!!! important
|
||||
|
||||
The usage of `quantity_point` and affine space types in general, improves expressiveness and
|
||||
type-safety of the code we write.
|
||||
|
||||
@@ -12,7 +12,7 @@ The second line above converts the current quantity to the one expressed in metr
|
||||
contents. The third line converts the quantity expressed in kilometres into the one measured
|
||||
in metres.
|
||||
|
||||
!!! note
|
||||
!!! important
|
||||
|
||||
It is always assumed that one can convert a quantity into another one with a unit of a higher
|
||||
resolution. There is no protection against overflow of the representation type. In case the target
|
||||
|
||||
Reference in New Issue
Block a user