refactor: systems defined in terms of SI moved under si namespace

This commit is contained in:
Mateusz Pusz
2020-09-10 17:14:33 +02:00
parent 7d204a1177
commit 79558a6d72
124 changed files with 580 additions and 587 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ be calculating the average speed based on provided distance and duration
quantities. The usage of such a function can look as follows::
using namespace units::physical::si::literals;
using namespace units::physical::international::literals;
using namespace units::physical::si::international::literals;
constexpr Speed auto v1 = avg_speed(220_q_km, 2_q_h);
constexpr Speed auto v2 = avg_speed(140_q_mi, 2_q_h);
+1 -1
View File
@@ -17,7 +17,7 @@ The easiest way to print a quantity is to provide its object to the output
stream::
using namespace units::physical::si::literals;
using namespace units::physical::international::literals;
using namespace units::physical::si::international::literals;
constexpr Speed auto v1 = avg_speed(220._q_km, 2_q_h);
constexpr Speed auto v2 = avg_speed(140._q_mi, 2_q_h);
std::cout << v1 << '\n'; // 110 km/h
+4 -4
View File
@@ -70,16 +70,16 @@ it really easy to define other systems of units. For example length in the
`CGS <https://en.wikipedia.org/wiki/Centimetre%E2%80%93gram%E2%80%93second_system_of_units>`_
could be defined as::
namespace cgs {
namespace si::cgs {
struct dim_length : base_dimension<"L", si::centimetre> {};
}
The fact that both base dimensions use the same identifier ``"L"`` tells
the library that bot definitions refer to the same physical dimension of
the library that both definitions refer to the same physical dimension of
length. The only difference is the measurement unit used to define their
base dimensions. Thanks to using `si::centimetre` in the `cgs::dim_length`
base dimensions. Thanks to using `si::centimetre` in the `si::cgs::dim_length`
definition we also enabled the ability to easily convert between those
2 base dimensions (as the library knows how to convert `si::metre` to
`si::centimetre` and vice versa).
@@ -308,7 +308,7 @@ In case the deduced unit should served as a named one we can use ether a
by him/her-self or `noble_deduced_unit` where the symbol is the deduced name
based on the ingredients::
namespace fps {
namespace si::fps {
struct nautical_mile_per_hour : named_deduced_unit<nautical_mile_per_hour, dim_speed,
"knot", no_prefix, nautical_mile, hour>{};