docs: Documentation updated for the latest unknown_coherent_unit changes

This commit is contained in:
Mateusz Pusz
2022-08-01 11:59:45 +02:00
parent 0ebf85b9db
commit d310bb1b8d
2 changed files with 8 additions and 8 deletions

View File

@@ -258,14 +258,14 @@ Even though the base dimension of ``si::fps`` is defined in terms of
``si::metre`` foot is preserved as the base unit of length in both systems:: ``si::metre`` foot is preserved as the base unit of length in both systems::
constexpr auto fps_yard = fps::length<fps::yard>(1.); constexpr auto fps_yard = fps::length<fps::yard>(1.);
constexpr auto fps_area = quantity_cast<unknown_coherent_unit>(fps_yard * fps_yard); constexpr auto fps_area = fps_yard * fps_yard;
std::cout << fps_yard << "\n"; // 1 yd std::cout << fps_yard << "\n"; // 1 yd
std::cout << fps_area << "\n"; // 9 ft² std::cout << quantity_cast<decltype(fps_area)::dimension::coherent_unit>(fps_area) << "\n"; // 9 ft²
constexpr auto si_fps_yard = si::fps::length<si::fps::yard>(1.); constexpr auto si_fps_yard = si::fps::length<si::fps::yard>(1.);
constexpr auto si_fps_area = quantity_cast<unknown_coherent_unit>(si_fps_yard * si_fps_yard); constexpr auto si_fps_area = si_fps_yard * si_fps_yard;
std::cout << si_fps_yard << "\n"; // 1 yd std::cout << si_fps_yard << "\n"; // 1 yd
std::cout << si_fps_area << "\n"; // 9 ft² std::cout << quantity_cast<decltype(si_fps_area)::dimension::coherent_unit>(si_fps_area) << "\n"; // 9 ft²
In most cases we want conversions between systems and that is why nearly all In most cases we want conversions between systems and that is why nearly all
systems provided with this library are implemented in terms on the :term:`SI` systems provided with this library are implemented in terms on the :term:`SI`

View File

@@ -52,7 +52,7 @@ dimensions used in the division operation:
static_assert(std::is_same_v<decltype(result)::dimension, static_assert(std::is_same_v<decltype(result)::dimension,
unknown_dimension<exponent<dim_length, 1>, exponent<dim_time, -1>>>); unknown_dimension<exponent<dim_length, 1>, exponent<dim_time, -1>>>);
static_assert(std::is_same_v<decltype(result)::unit, static_assert(std::is_same_v<decltype(result)::unit,
scaled_unit<ratio(1, 36, 1), unknown_coherent_unit>>); scaled_unit<ratio(1, 36, 1), unknown_coherent_unit<exponent<dim_length, 1>, exponent<dim_time, -1>>>>>);
.. important:: .. important::
@@ -81,7 +81,7 @@ this particular unknown derived dimension.
In case we would like to print the result in terms of base units we can simply do the In case we would like to print the result in terms of base units we can simply do the
following:: following::
auto s = quantity_cast<unknown_coherent_unit>(result); auto s = quantity_cast<decltype(result)::dimension::coherent_unit>(result);
std::cout << "Speed: " << s << '\n'; // prints 'Speed: 20 m/s' std::cout << "Speed: " << s << '\n'; // prints 'Speed: 20 m/s'
.. seealso:: .. seealso::