mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-04 12:54:25 +02:00
docs: Minor documentation related issues resolved
This commit is contained in:
@@ -56,12 +56,12 @@ Beside adding new elements a few other changes where applied compared to the
|
|||||||
`std::chrono::duration <https://en.cppreference.com/w/cpp/chrono/duration>`_
|
`std::chrono::duration <https://en.cppreference.com/w/cpp/chrono/duration>`_
|
||||||
class template:
|
class template:
|
||||||
|
|
||||||
1. The ``duration`` is using ``std::common_type_t<Rep1, Rep2>`` to find a common
|
1. The ``std::chrono::duration`` is using ``std::common_type_t<Rep1, Rep2>`` to find a common
|
||||||
representation for a calculation result. Such a design was reported as problematic
|
representation for a calculation result. Such a design was reported as problematic
|
||||||
by SG6 (numerics study group) members as sometimes we want to provide a different
|
by SG6 (numerics study group) members as sometimes we want to provide a different
|
||||||
type in case of multiplication and different in case of division. ``std::common_type``
|
type in case of multiplication and different in case of division. ``std::common_type``
|
||||||
lacks that additional information. That is why `units::quantity` uses the resulting
|
lacks that additional information. That is why `quantity` uses the resulting
|
||||||
type of a concrete operator operation.
|
type of a concrete operator operation.
|
||||||
2. `operator %` is constrained with `treat_as_floating_point` type trait to limit the
|
2. ``quantity::operator%()`` is constrained with `treat_as_floating_point` type trait to limit the
|
||||||
types to integral representations only. Also `operator %(Rep)` takes `Rep` as a
|
types to integral representations only. Also ``quantity::operator%(Rep)`` takes ``Rep`` as a
|
||||||
template argument to limit implicit conversions.
|
template argument to limit implicit conversions.
|
||||||
|
@@ -118,7 +118,7 @@ provided. For example the SI base dimension of length can be defined as::
|
|||||||
}
|
}
|
||||||
|
|
||||||
In the above code sample ``"L"`` is an base dimension's unique identifier
|
In the above code sample ``"L"`` is an base dimension's unique identifier
|
||||||
and `si::metre` is a :term:`base unit` of this base dimension. We can
|
and `physical::si::metre` is a :term:`base unit` of this base dimension. We can
|
||||||
obtain those back easily with::
|
obtain those back easily with::
|
||||||
|
|
||||||
static_assert(si::dim_length::symbol == "L");
|
static_assert(si::dim_length::symbol == "L");
|
||||||
@@ -153,9 +153,9 @@ The above dimensions can be defined in the library with the
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
In the above code sample `si::square_metre` and `si::metre_per_second`
|
In the above code sample `physical::si::square_metre` and
|
||||||
are the :term:`coherent derived units <coherent derived unit>` of those
|
`physical::si::metre_per_second` are the
|
||||||
derived dimensions.
|
:term:`coherent derived units <coherent derived unit>` of those derived dimensions.
|
||||||
|
|
||||||
Coherent unit argument is followed by the list of exponents that form this
|
Coherent unit argument is followed by the list of exponents that form this
|
||||||
derived dimension. This list is called a :term:`recipe` of this derived
|
derived dimension. This list is called a :term:`recipe` of this derived
|
||||||
|
@@ -18,7 +18,7 @@ This repository contains three independent CMake-based projects:
|
|||||||
but until then it depends on:
|
but until then it depends on:
|
||||||
|
|
||||||
- `{fmt} <https://github.com/fmtlib/fmt>`_ to provide text formatting of quantities.
|
- `{fmt} <https://github.com/fmtlib/fmt>`_ to provide text formatting of quantities.
|
||||||
- `ms-gsl <https://github.com/microsoft/GSL>`_ to verify runtime contracts with `Expects` macro.
|
- `ms-gsl <https://github.com/microsoft/GSL>`_ to verify runtime contracts with ``Expects`` macro.
|
||||||
|
|
||||||
- *.*
|
- *.*
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ defined by the library. To do so you should use *CMakeLists.txt* file from the *
|
|||||||
.. code-block:: cmake
|
.. code-block:: cmake
|
||||||
|
|
||||||
add_subdirectory(<path_to_units_folder>/src)
|
add_subdirectory(<path_to_units_folder>/src)
|
||||||
...
|
# ...
|
||||||
target_link_libraries(<your_target> PUBLIC|PRIVATE|INTERFACE mp-units::mp-units)
|
target_link_libraries(<your_target> PUBLIC|PRIVATE|INTERFACE mp-units::mp-units)
|
||||||
|
|
||||||
.. important::
|
.. important::
|
||||||
|
Reference in New Issue
Block a user