diff --git a/README.md b/README.md index d66527d5..1d547c16 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ the below example for a quick preview of basic library features: ```cpp #include -#include +#include #include #include @@ -69,7 +69,7 @@ int main() { using namespace units::physical::si::literals; Speed auto v1 = avg_speed(220_q_km, 2_q_h); - Speed auto v2 = avg_speed(si::length(140), si::time(2)); + Speed auto v2 = avg_speed(si::length(140), si::time(2)); Speed auto v3 = quantity_cast(v2); Speed auto v4 = quantity_cast(v3); diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 3634ca06..57134341 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -143,54 +143,54 @@ add_custom_command(OUTPUT "${SPHINX_INDEX_FILE}" # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/length.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/acceleration.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/area.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/energy.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/force.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/length.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/mass.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/power.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/pressure.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/speed.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/time.rst" - - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/dimensions_and_concepts.rst" - - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/length.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/acceleration.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/area.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/density.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/energy.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/force.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/length.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/mass.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/power.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/pressure.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/speed.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/time.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/volume.rst" - - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/iau.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/iau/length.rst" - - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/imperial.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/imperial/length.rst" - - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/international.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/international/area.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/international/length.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/international/speed.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/international/volume.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural.rst" # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural/constants.rst" # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural/dimensions.rst" # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural/units.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/length.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/acceleration.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/area.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/energy.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/force.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/length.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/mass.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/power.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/pressure.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/speed.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/time.rst" + + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/dimensions_and_concepts.rst" + + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/length.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/acceleration.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/area.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/density.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/energy.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/force.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/length.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/mass.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/power.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/pressure.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/speed.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/time.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/volume.rst" + + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/iau.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/iau/length.rst" + + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/imperial.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/imperial/length.rst" + + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/area.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/length.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/speed.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/volume.rst" + + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/si.rst" # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/absorbed_dose.rst" # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/acceleration.rst" # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/area.rst" @@ -234,11 +234,11 @@ add_custom_command(OUTPUT "${SPHINX_INDEX_FILE}" # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/voltage.rst" # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/volume.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/typographic.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/typographic/length.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/typographic.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/typographic/length.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/us.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/us/length.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/us.rst" + # "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/us/length.rst" "${CMAKE_CURRENT_SOURCE_DIR}/references.rst" diff --git a/docs/design/directories.rst b/docs/design/directories.rst index bc18ad18..cecb7843 100644 --- a/docs/design/directories.rst +++ b/docs/design/directories.rst @@ -10,14 +10,15 @@ Library Directories Structure │ └── external ├── data └── physical - ├── cgs - ├── iau - ├── imperial - ├── international ├── natural - ├── si - ├── typographic - └── us + └── si + ├── cgs + ├── fps + ├── iau + ├── imperial + ├── international + ├── typographic + └── us - *./units* diff --git a/docs/framework/quantities.rst b/docs/framework/quantities.rst index 93c1907f..56d92be1 100644 --- a/docs/framework/quantities.rst +++ b/docs/framework/quantities.rst @@ -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); diff --git a/docs/framework/text_output.rst b/docs/framework/text_output.rst index 2b7812d6..6dca6f71 100644 --- a/docs/framework/text_output.rst +++ b/docs/framework/text_output.rst @@ -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 diff --git a/docs/framework/units.rst b/docs/framework/units.rst index 52c9479e..3b4489e1 100644 --- a/docs/framework/units.rst +++ b/docs/framework/units.rst @@ -70,16 +70,16 @@ it really easy to define other systems of units. For example length in the `CGS `_ 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{}; diff --git a/docs/quick_start.rst b/docs/quick_start.rst index 28c3b738..86030b44 100644 --- a/docs/quick_start.rst +++ b/docs/quick_start.rst @@ -32,7 +32,7 @@ performed without sacrificing on accuracy. Please see the below example for a qu of basic library features:: #include - #include + #include #include #include @@ -47,7 +47,7 @@ of basic library features:: { using namespace units::physical::si::literals; Speed auto v1 = avg_speed(220_q_km, 2_q_h); - Speed auto v2 = avg_speed(si::length(140), si::time(2)); + Speed auto v2 = avg_speed(si::length(140), si::time(2)); Speed auto v3 = quantity_cast(v2); Speed auto v4 = quantity_cast(v3); diff --git a/docs_disabled/reference/systems/physical.rst b/docs_disabled/reference/systems/physical.rst index c0fab53e..8faa2480 100644 --- a/docs_disabled/reference/systems/physical.rst +++ b/docs_disabled/reference/systems/physical.rst @@ -6,11 +6,11 @@ Physical physical/dimensions_and_concepts physical/si - physical/cgs - physical/international - physical/us - physical/imperial - physical/fps - physical/iau - physical/typographic + physical/si_cgs + physical/si_international + physical/si_us + physical/si_imperial + physical/si_fps + physical/si_iau + physical/si_typographic physical/natural diff --git a/docs_disabled/reference/systems/physical/cgs.rst b/docs_disabled/reference/systems/physical/cgs.rst deleted file mode 100644 index 1da5312a..00000000 --- a/docs_disabled/reference/systems/physical/cgs.rst +++ /dev/null @@ -1,16 +0,0 @@ -CGS -=== - -.. toctree:: - :maxdepth: 2 - - cgs/acceleration - cgs/area - cgs/energy - cgs/force - cgs/length - cgs/mass - cgs/power - cgs/pressure - cgs/speed - cgs/time diff --git a/docs_disabled/reference/systems/physical/cgs/acceleration.rst b/docs_disabled/reference/systems/physical/cgs/acceleration.rst deleted file mode 100644 index 3dd962c4..00000000 --- a/docs_disabled/reference/systems/physical/cgs/acceleration.rst +++ /dev/null @@ -1,4 +0,0 @@ -Acceleration -============ - -.. doxygenfile:: cgs/acceleration.h diff --git a/docs_disabled/reference/systems/physical/cgs/area.rst b/docs_disabled/reference/systems/physical/cgs/area.rst deleted file mode 100644 index 2bf580e3..00000000 --- a/docs_disabled/reference/systems/physical/cgs/area.rst +++ /dev/null @@ -1,4 +0,0 @@ -Area -==== - -.. doxygenfile:: cgs/area.h diff --git a/docs_disabled/reference/systems/physical/cgs/energy.rst b/docs_disabled/reference/systems/physical/cgs/energy.rst deleted file mode 100644 index e13dc998..00000000 --- a/docs_disabled/reference/systems/physical/cgs/energy.rst +++ /dev/null @@ -1,4 +0,0 @@ -Energy -====== - -.. doxygenfile:: cgs/energy.h diff --git a/docs_disabled/reference/systems/physical/cgs/force.rst b/docs_disabled/reference/systems/physical/cgs/force.rst deleted file mode 100644 index d2d8cc09..00000000 --- a/docs_disabled/reference/systems/physical/cgs/force.rst +++ /dev/null @@ -1,4 +0,0 @@ -Force -===== - -.. doxygenfile:: cgs/force.h diff --git a/docs_disabled/reference/systems/physical/cgs/length.rst b/docs_disabled/reference/systems/physical/cgs/length.rst deleted file mode 100644 index 169709d6..00000000 --- a/docs_disabled/reference/systems/physical/cgs/length.rst +++ /dev/null @@ -1,4 +0,0 @@ -Length -====== - -.. doxygenfile:: cgs/length.h diff --git a/docs_disabled/reference/systems/physical/cgs/mass.rst b/docs_disabled/reference/systems/physical/cgs/mass.rst deleted file mode 100644 index 6515d9a3..00000000 --- a/docs_disabled/reference/systems/physical/cgs/mass.rst +++ /dev/null @@ -1,4 +0,0 @@ -Mass -==== - -.. doxygenfile:: cgs/mass.h diff --git a/docs_disabled/reference/systems/physical/cgs/power.rst b/docs_disabled/reference/systems/physical/cgs/power.rst deleted file mode 100644 index 64e3a6a5..00000000 --- a/docs_disabled/reference/systems/physical/cgs/power.rst +++ /dev/null @@ -1,4 +0,0 @@ -Power -===== - -.. doxygenfile:: cgs/power.h diff --git a/docs_disabled/reference/systems/physical/cgs/pressure.rst b/docs_disabled/reference/systems/physical/cgs/pressure.rst deleted file mode 100644 index 719f32d3..00000000 --- a/docs_disabled/reference/systems/physical/cgs/pressure.rst +++ /dev/null @@ -1,4 +0,0 @@ -Pressure -======== - -.. doxygenfile:: cgs/pressure.h diff --git a/docs_disabled/reference/systems/physical/cgs/speed.rst b/docs_disabled/reference/systems/physical/cgs/speed.rst deleted file mode 100644 index 6f91e5ce..00000000 --- a/docs_disabled/reference/systems/physical/cgs/speed.rst +++ /dev/null @@ -1,4 +0,0 @@ -Speed -===== - -.. doxygenfile:: cgs/speed.h diff --git a/docs_disabled/reference/systems/physical/cgs/time.rst b/docs_disabled/reference/systems/physical/cgs/time.rst deleted file mode 100644 index 6bba9774..00000000 --- a/docs_disabled/reference/systems/physical/cgs/time.rst +++ /dev/null @@ -1,4 +0,0 @@ -Time -==== - -.. doxygenfile:: cgs/time.h diff --git a/docs_disabled/reference/systems/physical/fps.rst b/docs_disabled/reference/systems/physical/fps.rst deleted file mode 100644 index 31308a5e..00000000 --- a/docs_disabled/reference/systems/physical/fps.rst +++ /dev/null @@ -1,18 +0,0 @@ -FPS -=== - -.. toctree:: - :maxdepth: 2 - - fps/acceleration - fps/area - fps/density - fps/energy - fps/force - fps/length - fps/mass - fps/power - fps/pressure - fps/speed - fps/time - fps/volume diff --git a/docs_disabled/reference/systems/physical/fps/acceleration.rst b/docs_disabled/reference/systems/physical/fps/acceleration.rst deleted file mode 100644 index 53b59605..00000000 --- a/docs_disabled/reference/systems/physical/fps/acceleration.rst +++ /dev/null @@ -1,4 +0,0 @@ -Acceleration -============ - -.. doxygenfile:: fps/acceleration.h diff --git a/docs_disabled/reference/systems/physical/fps/area.rst b/docs_disabled/reference/systems/physical/fps/area.rst deleted file mode 100644 index 4e67f9f0..00000000 --- a/docs_disabled/reference/systems/physical/fps/area.rst +++ /dev/null @@ -1,4 +0,0 @@ -Area -==== - -.. doxygenfile:: fps/area.h diff --git a/docs_disabled/reference/systems/physical/fps/density.rst b/docs_disabled/reference/systems/physical/fps/density.rst deleted file mode 100644 index 81244e83..00000000 --- a/docs_disabled/reference/systems/physical/fps/density.rst +++ /dev/null @@ -1,4 +0,0 @@ -Density -======= - -.. doxygenfile:: fps/density.h diff --git a/docs_disabled/reference/systems/physical/fps/energy.rst b/docs_disabled/reference/systems/physical/fps/energy.rst deleted file mode 100644 index 95e41248..00000000 --- a/docs_disabled/reference/systems/physical/fps/energy.rst +++ /dev/null @@ -1,4 +0,0 @@ -Energy -====== - -.. doxygenfile:: fps/energy.h diff --git a/docs_disabled/reference/systems/physical/fps/force.rst b/docs_disabled/reference/systems/physical/fps/force.rst deleted file mode 100644 index b5bfa94c..00000000 --- a/docs_disabled/reference/systems/physical/fps/force.rst +++ /dev/null @@ -1,4 +0,0 @@ -Force -===== - -.. doxygenfile:: fps/force.h diff --git a/docs_disabled/reference/systems/physical/fps/length.rst b/docs_disabled/reference/systems/physical/fps/length.rst deleted file mode 100644 index 7d90dc3f..00000000 --- a/docs_disabled/reference/systems/physical/fps/length.rst +++ /dev/null @@ -1,4 +0,0 @@ -Length -====== - -.. doxygenfile:: fps/length.h diff --git a/docs_disabled/reference/systems/physical/fps/mass.rst b/docs_disabled/reference/systems/physical/fps/mass.rst deleted file mode 100644 index cf6295f5..00000000 --- a/docs_disabled/reference/systems/physical/fps/mass.rst +++ /dev/null @@ -1,4 +0,0 @@ -Mass -==== - -.. doxygenfile:: fps/mass.h diff --git a/docs_disabled/reference/systems/physical/fps/power.rst b/docs_disabled/reference/systems/physical/fps/power.rst deleted file mode 100644 index 2bb49e3a..00000000 --- a/docs_disabled/reference/systems/physical/fps/power.rst +++ /dev/null @@ -1,4 +0,0 @@ -Power -===== - -.. doxygenfile:: fps/power.h diff --git a/docs_disabled/reference/systems/physical/fps/pressure.rst b/docs_disabled/reference/systems/physical/fps/pressure.rst deleted file mode 100644 index e97bb249..00000000 --- a/docs_disabled/reference/systems/physical/fps/pressure.rst +++ /dev/null @@ -1,4 +0,0 @@ -Pressure -======== - -.. doxygenfile:: fps/pressure.h diff --git a/docs_disabled/reference/systems/physical/fps/speed.rst b/docs_disabled/reference/systems/physical/fps/speed.rst deleted file mode 100644 index 6631ae67..00000000 --- a/docs_disabled/reference/systems/physical/fps/speed.rst +++ /dev/null @@ -1,4 +0,0 @@ -Speed -===== - -.. doxygenfile:: fps/speed.h diff --git a/docs_disabled/reference/systems/physical/fps/time.rst b/docs_disabled/reference/systems/physical/fps/time.rst deleted file mode 100644 index d53013c8..00000000 --- a/docs_disabled/reference/systems/physical/fps/time.rst +++ /dev/null @@ -1,4 +0,0 @@ -Time -==== - -.. doxygenfile:: fps/time.h diff --git a/docs_disabled/reference/systems/physical/fps/volume.rst b/docs_disabled/reference/systems/physical/fps/volume.rst deleted file mode 100644 index 8a9ebe5d..00000000 --- a/docs_disabled/reference/systems/physical/fps/volume.rst +++ /dev/null @@ -1,4 +0,0 @@ -Volume -====== - -.. doxygenfile:: fps/volume.h diff --git a/docs_disabled/reference/systems/physical/iau/length.rst b/docs_disabled/reference/systems/physical/iau/length.rst deleted file mode 100644 index fe70586e..00000000 --- a/docs_disabled/reference/systems/physical/iau/length.rst +++ /dev/null @@ -1,4 +0,0 @@ -Length -====== - -.. doxygenfile:: iau/length.h diff --git a/docs_disabled/reference/systems/physical/imperial/length.rst b/docs_disabled/reference/systems/physical/imperial/length.rst deleted file mode 100644 index e7e4cf98..00000000 --- a/docs_disabled/reference/systems/physical/imperial/length.rst +++ /dev/null @@ -1,4 +0,0 @@ -Length -====== - -.. doxygenfile:: imperial/length.h diff --git a/docs_disabled/reference/systems/physical/international.rst b/docs_disabled/reference/systems/physical/international.rst deleted file mode 100644 index ddfcd7fe..00000000 --- a/docs_disabled/reference/systems/physical/international.rst +++ /dev/null @@ -1,10 +0,0 @@ -International -============= - -.. toctree:: - :maxdepth: 2 - - international/area - international/length - international/speed - international/volume diff --git a/docs_disabled/reference/systems/physical/international/area.rst b/docs_disabled/reference/systems/physical/international/area.rst deleted file mode 100644 index b6a78dd0..00000000 --- a/docs_disabled/reference/systems/physical/international/area.rst +++ /dev/null @@ -1,4 +0,0 @@ -Area -==== - -.. doxygenfile:: international/area.h diff --git a/docs_disabled/reference/systems/physical/international/length.rst b/docs_disabled/reference/systems/physical/international/length.rst deleted file mode 100644 index 47e11684..00000000 --- a/docs_disabled/reference/systems/physical/international/length.rst +++ /dev/null @@ -1,4 +0,0 @@ -Length -====== - -.. doxygenfile:: international/length.h diff --git a/docs_disabled/reference/systems/physical/international/volume.rst b/docs_disabled/reference/systems/physical/international/volume.rst deleted file mode 100644 index 5638e913..00000000 --- a/docs_disabled/reference/systems/physical/international/volume.rst +++ /dev/null @@ -1,4 +0,0 @@ -Volume -====== - -.. doxygenfile:: international/volume.h diff --git a/docs_disabled/reference/systems/physical/si/cgs/acceleration.rst b/docs_disabled/reference/systems/physical/si/cgs/acceleration.rst new file mode 100644 index 00000000..4a04598d --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/cgs/acceleration.rst @@ -0,0 +1,4 @@ +Acceleration +============ + +.. doxygenfile:: si/cgs/acceleration.h diff --git a/docs_disabled/reference/systems/physical/si/cgs/area.rst b/docs_disabled/reference/systems/physical/si/cgs/area.rst new file mode 100644 index 00000000..e97b1dfa --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/cgs/area.rst @@ -0,0 +1,4 @@ +Area +==== + +.. doxygenfile:: si/cgs/area.h diff --git a/docs_disabled/reference/systems/physical/si/cgs/energy.rst b/docs_disabled/reference/systems/physical/si/cgs/energy.rst new file mode 100644 index 00000000..1026e75f --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/cgs/energy.rst @@ -0,0 +1,4 @@ +Energy +====== + +.. doxygenfile:: si/cgs/energy.h diff --git a/docs_disabled/reference/systems/physical/si/cgs/force.rst b/docs_disabled/reference/systems/physical/si/cgs/force.rst new file mode 100644 index 00000000..4f3e2cb5 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/cgs/force.rst @@ -0,0 +1,4 @@ +Force +===== + +.. doxygenfile:: si/cgs/force.h diff --git a/docs_disabled/reference/systems/physical/si/cgs/length.rst b/docs_disabled/reference/systems/physical/si/cgs/length.rst new file mode 100644 index 00000000..5deefb4b --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/cgs/length.rst @@ -0,0 +1,4 @@ +Length +====== + +.. doxygenfile:: si/cgs/length.h diff --git a/docs_disabled/reference/systems/physical/si/cgs/mass.rst b/docs_disabled/reference/systems/physical/si/cgs/mass.rst new file mode 100644 index 00000000..9be1a471 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/cgs/mass.rst @@ -0,0 +1,4 @@ +Mass +==== + +.. doxygenfile:: si/cgs/mass.h diff --git a/docs_disabled/reference/systems/physical/si/cgs/power.rst b/docs_disabled/reference/systems/physical/si/cgs/power.rst new file mode 100644 index 00000000..8725ef62 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/cgs/power.rst @@ -0,0 +1,4 @@ +Power +===== + +.. doxygenfile:: si/cgs/power.h diff --git a/docs_disabled/reference/systems/physical/si/cgs/pressure.rst b/docs_disabled/reference/systems/physical/si/cgs/pressure.rst new file mode 100644 index 00000000..5efd0777 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/cgs/pressure.rst @@ -0,0 +1,4 @@ +Pressure +======== + +.. doxygenfile:: si/cgs/pressure.h diff --git a/docs_disabled/reference/systems/physical/si/cgs/speed.rst b/docs_disabled/reference/systems/physical/si/cgs/speed.rst new file mode 100644 index 00000000..37d6226e --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/cgs/speed.rst @@ -0,0 +1,4 @@ +Speed +===== + +.. doxygenfile:: si/cgs/speed.h diff --git a/docs_disabled/reference/systems/physical/si/cgs/time.rst b/docs_disabled/reference/systems/physical/si/cgs/time.rst new file mode 100644 index 00000000..30e42097 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/cgs/time.rst @@ -0,0 +1,4 @@ +Time +==== + +.. doxygenfile:: si/cgs/time.h diff --git a/docs_disabled/reference/systems/physical/si/fps/acceleration.rst b/docs_disabled/reference/systems/physical/si/fps/acceleration.rst new file mode 100644 index 00000000..dfc5d510 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/fps/acceleration.rst @@ -0,0 +1,4 @@ +Acceleration +============ + +.. doxygenfile:: si/fps/acceleration.h diff --git a/docs_disabled/reference/systems/physical/si/fps/area.rst b/docs_disabled/reference/systems/physical/si/fps/area.rst new file mode 100644 index 00000000..00cc067c --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/fps/area.rst @@ -0,0 +1,4 @@ +Area +==== + +.. doxygenfile:: si/fps/area.h diff --git a/docs_disabled/reference/systems/physical/si/fps/density.rst b/docs_disabled/reference/systems/physical/si/fps/density.rst new file mode 100644 index 00000000..c0b70ddf --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/fps/density.rst @@ -0,0 +1,4 @@ +Density +======= + +.. doxygenfile:: si/fps/density.h diff --git a/docs_disabled/reference/systems/physical/si/fps/energy.rst b/docs_disabled/reference/systems/physical/si/fps/energy.rst new file mode 100644 index 00000000..949cbd91 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/fps/energy.rst @@ -0,0 +1,4 @@ +Energy +====== + +.. doxygenfile:: si/fps/energy.h diff --git a/docs_disabled/reference/systems/physical/si/fps/force.rst b/docs_disabled/reference/systems/physical/si/fps/force.rst new file mode 100644 index 00000000..02b355b7 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/fps/force.rst @@ -0,0 +1,4 @@ +Force +===== + +.. doxygenfile:: si/fps/force.h diff --git a/docs_disabled/reference/systems/physical/si/fps/length.rst b/docs_disabled/reference/systems/physical/si/fps/length.rst new file mode 100644 index 00000000..e32c16f3 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/fps/length.rst @@ -0,0 +1,4 @@ +Length +====== + +.. doxygenfile:: si/fps/length.h diff --git a/docs_disabled/reference/systems/physical/si/fps/mass.rst b/docs_disabled/reference/systems/physical/si/fps/mass.rst new file mode 100644 index 00000000..e77ac1ba --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/fps/mass.rst @@ -0,0 +1,4 @@ +Mass +==== + +.. doxygenfile:: si/fps/mass.h diff --git a/docs_disabled/reference/systems/physical/si/fps/power.rst b/docs_disabled/reference/systems/physical/si/fps/power.rst new file mode 100644 index 00000000..28f52f3c --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/fps/power.rst @@ -0,0 +1,4 @@ +Power +===== + +.. doxygenfile:: si/fps/power.h diff --git a/docs_disabled/reference/systems/physical/si/fps/pressure.rst b/docs_disabled/reference/systems/physical/si/fps/pressure.rst new file mode 100644 index 00000000..5144b50d --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/fps/pressure.rst @@ -0,0 +1,4 @@ +Pressure +======== + +.. doxygenfile:: si/fps/pressure.h diff --git a/docs_disabled/reference/systems/physical/si/fps/speed.rst b/docs_disabled/reference/systems/physical/si/fps/speed.rst new file mode 100644 index 00000000..3f3388d9 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/fps/speed.rst @@ -0,0 +1,4 @@ +Speed +===== + +.. doxygenfile:: si/fps/speed.h diff --git a/docs_disabled/reference/systems/physical/si/fps/time.rst b/docs_disabled/reference/systems/physical/si/fps/time.rst new file mode 100644 index 00000000..0be4a9ad --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/fps/time.rst @@ -0,0 +1,4 @@ +Time +==== + +.. doxygenfile:: si/fps/time.h diff --git a/docs_disabled/reference/systems/physical/si/fps/volume.rst b/docs_disabled/reference/systems/physical/si/fps/volume.rst new file mode 100644 index 00000000..788fd445 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/fps/volume.rst @@ -0,0 +1,4 @@ +Volume +====== + +.. doxygenfile:: si/fps/volume.h diff --git a/docs_disabled/reference/systems/physical/si/iau/length.rst b/docs_disabled/reference/systems/physical/si/iau/length.rst new file mode 100644 index 00000000..a87bd7b7 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/iau/length.rst @@ -0,0 +1,4 @@ +Length +====== + +.. doxygenfile:: si/iau/length.h diff --git a/docs_disabled/reference/systems/physical/si/imperial/length.rst b/docs_disabled/reference/systems/physical/si/imperial/length.rst new file mode 100644 index 00000000..bf66246d --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/imperial/length.rst @@ -0,0 +1,4 @@ +Length +====== + +.. doxygenfile:: si/imperial/length.h diff --git a/docs_disabled/reference/systems/physical/si/international/area.rst b/docs_disabled/reference/systems/physical/si/international/area.rst new file mode 100644 index 00000000..f4841300 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/international/area.rst @@ -0,0 +1,4 @@ +Area +==== + +.. doxygenfile:: si/international/area.h diff --git a/docs_disabled/reference/systems/physical/si/international/length.rst b/docs_disabled/reference/systems/physical/si/international/length.rst new file mode 100644 index 00000000..878b4b17 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/international/length.rst @@ -0,0 +1,4 @@ +Length +====== + +.. doxygenfile:: si/international/length.h diff --git a/docs_disabled/reference/systems/physical/international/speed.rst b/docs_disabled/reference/systems/physical/si/international/speed.rst similarity index 100% rename from docs_disabled/reference/systems/physical/international/speed.rst rename to docs_disabled/reference/systems/physical/si/international/speed.rst diff --git a/docs_disabled/reference/systems/physical/si/international/volume.rst b/docs_disabled/reference/systems/physical/si/international/volume.rst new file mode 100644 index 00000000..2530bbbe --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/international/volume.rst @@ -0,0 +1,4 @@ +Volume +====== + +.. doxygenfile:: si/international/volume.h diff --git a/docs_disabled/reference/systems/physical/si/typographic/length.rst b/docs_disabled/reference/systems/physical/si/typographic/length.rst new file mode 100644 index 00000000..363fc1f6 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/typographic/length.rst @@ -0,0 +1,4 @@ +Length +====== + +.. doxygenfile:: si/typographic/length.h diff --git a/docs_disabled/reference/systems/physical/si/us/length.rst b/docs_disabled/reference/systems/physical/si/us/length.rst new file mode 100644 index 00000000..97e365ad --- /dev/null +++ b/docs_disabled/reference/systems/physical/si/us/length.rst @@ -0,0 +1,4 @@ +Length +====== + +.. doxygenfile:: si/us/length.h diff --git a/docs_disabled/reference/systems/physical/si_cgs.rst b/docs_disabled/reference/systems/physical/si_cgs.rst new file mode 100644 index 00000000..18a7f82e --- /dev/null +++ b/docs_disabled/reference/systems/physical/si_cgs.rst @@ -0,0 +1,16 @@ +CGS +=== + +.. toctree:: + :maxdepth: 2 + + si/cgs/acceleration + si/cgs/area + si/cgs/energy + si/cgs/force + si/cgs/length + si/cgs/mass + si/cgs/power + si/cgs/pressure + si/cgs/speed + si/cgs/time diff --git a/docs_disabled/reference/systems/physical/si_fps.rst b/docs_disabled/reference/systems/physical/si_fps.rst new file mode 100644 index 00000000..15c7d45a --- /dev/null +++ b/docs_disabled/reference/systems/physical/si_fps.rst @@ -0,0 +1,18 @@ +FPS +=== + +.. toctree:: + :maxdepth: 2 + + si/fps/acceleration + si/fps/area + si/fps/density + si/fps/energy + si/fps/force + si/fps/length + si/fps/mass + si/fps/power + si/fps/pressure + si/fps/speed + si/fps/time + si/fps/volume diff --git a/docs_disabled/reference/systems/physical/iau.rst b/docs_disabled/reference/systems/physical/si_iau.rst similarity index 68% rename from docs_disabled/reference/systems/physical/iau.rst rename to docs_disabled/reference/systems/physical/si_iau.rst index e038ee61..f6131159 100644 --- a/docs_disabled/reference/systems/physical/iau.rst +++ b/docs_disabled/reference/systems/physical/si_iau.rst @@ -4,4 +4,4 @@ IAU .. toctree:: :maxdepth: 2 - iau/length + si/iau/length diff --git a/docs_disabled/reference/systems/physical/imperial.rst b/docs_disabled/reference/systems/physical/si_imperial.rst similarity index 68% rename from docs_disabled/reference/systems/physical/imperial.rst rename to docs_disabled/reference/systems/physical/si_imperial.rst index d8d4c6c2..29206340 100644 --- a/docs_disabled/reference/systems/physical/imperial.rst +++ b/docs_disabled/reference/systems/physical/si_imperial.rst @@ -4,4 +4,4 @@ Imperial .. toctree:: :maxdepth: 2 - imperial/length + si/imperial/length diff --git a/docs_disabled/reference/systems/physical/si_international.rst b/docs_disabled/reference/systems/physical/si_international.rst new file mode 100644 index 00000000..aa987525 --- /dev/null +++ b/docs_disabled/reference/systems/physical/si_international.rst @@ -0,0 +1,10 @@ +International +============= + +.. toctree:: + :maxdepth: 2 + + si/international/area + si/international/length + si/international/speed + si/international/volume diff --git a/docs_disabled/reference/systems/physical/typographic.rst b/docs_disabled/reference/systems/physical/si_typographic.rst similarity index 68% rename from docs_disabled/reference/systems/physical/typographic.rst rename to docs_disabled/reference/systems/physical/si_typographic.rst index f43b1e38..f59bc140 100644 --- a/docs_disabled/reference/systems/physical/typographic.rst +++ b/docs_disabled/reference/systems/physical/si_typographic.rst @@ -4,4 +4,4 @@ Typographic .. toctree:: :maxdepth: 2 - typographic/length + si/typographic/length diff --git a/docs_disabled/reference/systems/physical/us.rst b/docs_disabled/reference/systems/physical/si_us.rst similarity index 69% rename from docs_disabled/reference/systems/physical/us.rst rename to docs_disabled/reference/systems/physical/si_us.rst index 4dc5d16f..c609285a 100644 --- a/docs_disabled/reference/systems/physical/us.rst +++ b/docs_disabled/reference/systems/physical/si_us.rst @@ -4,4 +4,4 @@ US .. toctree:: :maxdepth: 2 - us/length + si/us/length diff --git a/docs_disabled/reference/systems/physical/typographic/length.rst b/docs_disabled/reference/systems/physical/typographic/length.rst deleted file mode 100644 index 140e425b..00000000 --- a/docs_disabled/reference/systems/physical/typographic/length.rst +++ /dev/null @@ -1,4 +0,0 @@ -Length -====== - -.. doxygenfile:: typographic/length.h diff --git a/docs_disabled/reference/systems/physical/us/length.rst b/docs_disabled/reference/systems/physical/us/length.rst deleted file mode 100644 index 97402bd1..00000000 --- a/docs_disabled/reference/systems/physical/us/length.rst +++ /dev/null @@ -1,4 +0,0 @@ -Length -====== - -.. doxygenfile:: us/length.h diff --git a/example/alternative_namespaces/clcpp_response.cpp b/example/alternative_namespaces/clcpp_response.cpp index ab79d586..a7c4c2fc 100644 --- a/example/alternative_namespaces/clcpp_response.cpp +++ b/example/alternative_namespaces/clcpp_response.cpp @@ -25,7 +25,7 @@ #include "./units_str.h" using namespace units::physical::si::literals; -using namespace units::physical::international; +using namespace units::physical::si::international; using namespace units::experimental; void simple_quantities() diff --git a/example/alternative_namespaces/length.h b/example/alternative_namespaces/length.h index 8d0f94f9..d9a40687 100644 --- a/example/alternative_namespaces/length.h +++ b/example/alternative_namespaces/length.h @@ -3,11 +3,11 @@ #pragma once #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace units{ namespace experimental{ @@ -30,55 +30,55 @@ template using AU = units::physical::si::length; template -using in = units::physical::si::length; +using in = units::physical::si::length; template -using angstrom = units::physical::si::length; +using angstrom = units::physical::si::length; template -using ch = units::physical::si::length; +using ch = units::physical::si::length; template -using fathom = units::physical::si::length; +using fathom = units::physical::si::length; template -using fathom_us = units::physical::si::length; +using fathom_us = units::physical::si::length; template -using ft = units::physical::si::length; +using ft = units::physical::si::length; template -using ft_us = units::physical::si::length; +using ft_us = units::physical::si::length; template -using ly = units::physical::si::length; +using ly = units::physical::si::length; template -using mi = units::physical::si::length; +using mi = units::physical::si::length; template -using mi_naut = units::physical::si::length; +using mi_naut = units::physical::si::length; template -using pc = units::physical::si::length; +using pc = units::physical::si::length; template -using pica_comp = units::physical::si::length; +using pica_comp = units::physical::si::length; template -using pica_prn = units::physical::si::length; +using pica_prn = units::physical::si::length; template -using point_comp = units::physical::si::length; +using point_comp = units::physical::si::length; template -using point_prn = units::physical::si::length; +using point_prn = units::physical::si::length; template -using rd = units::physical::si::length; +using rd = units::physical::si::length; template -using yd = units::physical::si::length; +using yd = units::physical::si::length; } // namespace length diff --git a/example/avg_speed.cpp b/example/avg_speed.cpp index 7021ee0d..cee5442c 100644 --- a/example/avg_speed.cpp +++ b/example/avg_speed.cpp @@ -20,9 +20,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -#include +#include +#include #include -#include #include namespace { @@ -97,7 +97,7 @@ void example() // Customary Units (int) { - using namespace units::physical::international::literals; + using namespace units::physical::si::international::literals; constexpr Length auto distance = 140_q_mi; // constructed from a UDL constexpr si::time duration(2); // constructed from a value @@ -113,7 +113,7 @@ void example() // Customary Units (double) { - using namespace units::physical::international::literals; + using namespace units::physical::si::international::literals; constexpr Length auto distance = 140._q_mi; // constructed from a UDL constexpr si::time duration(2); // constructed from a value @@ -131,9 +131,9 @@ void example() // CGS (int) { - using namespace units::physical::cgs::literals; + using namespace units::physical::si::cgs::literals; constexpr Length auto distance = 22'000'000_q_cm; // constructed from a UDL - constexpr cgs::time duration(2); // constructed from a value + constexpr si::cgs::time duration(2); // constructed from a value std::cout << "\nCGS units with 'int' as representation\n"; @@ -150,9 +150,9 @@ void example() // CGS (double) { - using namespace units::physical::cgs::literals; + using namespace units::physical::si::cgs::literals; constexpr Length auto distance = 22'000'000._q_cm; // constructed from a UDL - constexpr cgs::time duration(2); // constructed from a value + constexpr si::cgs::time duration(2); // constructed from a value std::cout << "\nCGS units with 'double' as representation\n"; diff --git a/example/clcpp_response.cpp b/example/clcpp_response.cpp index c8e7f913..d94e66de 100644 --- a/example/clcpp_response.cpp +++ b/example/clcpp_response.cpp @@ -15,16 +15,16 @@ along with this program. If not, see http://www.gnu.org/licenses./ */ -#include -#include -#include +#include #include +#include +#include +#include #include #include +#include +#include #include -#include -#include -#include #include namespace { @@ -34,7 +34,7 @@ using namespace units; void simple_quantities() { using namespace units::physical::si; - using namespace units::physical::international; + using namespace units::physical::si::international; using distance = length; using duration = physical::si::time; @@ -59,7 +59,7 @@ void quantities_with_typed_units() { using namespace units::physical; using namespace units::physical::si; - using namespace units::physical::international; + using namespace units::physical::si::international; constexpr length km = 1.0_q_km; constexpr length miles = 1.0_q_mi; @@ -84,23 +84,23 @@ void quantities_with_typed_units() std::cout << meter << '\n'; std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; - std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; + std::cout << " = " << quantity_cast(meter) << '\n'; } void calcs_comparison() diff --git a/example/foot_pound_second.cpp b/example/foot_pound_second.cpp index 6c51fc05..81d64649 100644 --- a/example/foot_pound_second.cpp +++ b/example/foot_pound_second.cpp @@ -20,22 +20,20 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include #include #include - -#include #include - #include using namespace units::physical; @@ -43,17 +41,17 @@ using namespace units::physical; // Some basic specs for the warship struct Ship { - fps::length length; - fps::length draft; - fps::length beam; + si::fps::length length; + si::fps::length draft; + si::fps::length beam; - fps::speed speed; - fps::mass mass; + si::fps::speed speed; + si::fps::mass mass; - fps::length mainGuns; - fps::mass shellMass; - fps::speed shellSpeed; - fps::power power; + si::fps::length mainGuns; + si::fps::mass shellMass; + si::fps::speed shellSpeed; + si::fps::power power; }; // Print 'a' in its current units and print its value cast to the units in each of Args @@ -63,28 +61,28 @@ auto fmt_line(const Q a) return fmt::format("{:22}", a) + (fmt::format(",{:20}", units::quantity_cast(a)) + ...); } -// Print the ship details in the units as defined in the Ship struct, in other imperial units, and in SI +// Print the ship details in the units as defined in the Ship struct, in other si::imperial units, and in SI void print_details(std::string_view description, const Ship& ship) { - using namespace units::physical::fps::literals; + using namespace units::physical::si::fps::literals; const auto waterDensity = 62.4_q_lb_per_ft3; std::cout << fmt::format("{}\n", description); - std::cout << fmt::format("{:20} : {}\n", "length", fmt_line, si::length>(ship.length)) - << fmt::format("{:20} : {}\n", "draft", fmt_line, si::length>(ship.draft)) - << fmt::format("{:20} : {}\n", "beam", fmt_line, si::length>(ship.beam)) - << fmt::format("{:20} : {}\n", "mass", fmt_line, si::mass>(ship.mass)) - << fmt::format("{:20} : {}\n", "speed", fmt_line, si::speed>(ship.speed)) - << fmt::format("{:20} : {}\n", "power", fmt_line, si::power>(ship.power)) - << fmt::format("{:20} : {}\n", "main guns", fmt_line, si::length>(ship.mainGuns)) - << fmt::format("{:20} : {}\n", "fire shells weighing",fmt_line, si::mass>(ship.shellMass)) - << fmt::format("{:20} : {}\n", "fire shells at",fmt_line, si::speed>(ship.shellSpeed)) + std::cout << fmt::format("{:20} : {}\n", "length", fmt_line, si::length>(ship.length)) + << fmt::format("{:20} : {}\n", "draft", fmt_line, si::length>(ship.draft)) + << fmt::format("{:20} : {}\n", "beam", fmt_line, si::length>(ship.beam)) + << fmt::format("{:20} : {}\n", "mass", fmt_line, si::mass>(ship.mass)) + << fmt::format("{:20} : {}\n", "speed", fmt_line, si::speed>(ship.speed)) + << fmt::format("{:20} : {}\n", "power", fmt_line, si::power>(ship.power)) + << fmt::format("{:20} : {}\n", "main guns", fmt_line, si::length>(ship.mainGuns)) + << fmt::format("{:20} : {}\n", "fire shells weighing",fmt_line, si::mass>(ship.shellMass)) + << fmt::format("{:20} : {}\n", "fire shells at",fmt_line, si::speed>(ship.shellSpeed)) << fmt::format("{:20} : {}\n", "volume underwater", fmt_line, si::volume>(ship.mass / waterDensity)); } int main() { using namespace units::physical::si::literals; - using namespace units::physical::fps::literals; + using namespace units::physical::si::fps::literals; // KMS Bismark, using the units the Germans would use, taken from Wiki auto bismark = Ship{.length{251._q_m}, .draft{9.3_q_m}, .beam{36_q_m}, .speed{56_q_km_per_h}, .mass{50'300_q_t}, .mainGuns{380_q_mm}, .shellMass{800_q_kg}, .shellSpeed{820._q_m_per_s}, .power{110.45_q_kW}}; diff --git a/example/glide_computer.cpp b/example/glide_computer.cpp index 82d2085c..cdcf8a30 100644 --- a/example/glide_computer.cpp +++ b/example/glide_computer.cpp @@ -20,14 +20,14 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -#include -#include -#include #include +#include +#include +#include #include #include -#include #include +#include // horizontal/vertical vector namespace { @@ -202,7 +202,7 @@ struct fmt::formatter : formatter> { namespace { using namespace units::physical::si::literals; -using namespace units::physical::international::literals; +using namespace units::physical::si::international::literals; struct glider { struct polar_point { diff --git a/example/hello_units.cpp b/example/hello_units.cpp index cad84cf8..d4cb2581 100644 --- a/example/hello_units.cpp +++ b/example/hello_units.cpp @@ -20,9 +20,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -#include -#include #include +#include +#include #include using namespace units::physical; @@ -36,7 +36,7 @@ int main() { using namespace units::physical::si::literals; Speed auto v1 = avg_speed(220_q_km, 2_q_h); - Speed auto v2 = avg_speed(si::length(140), si::time(2)); + Speed auto v2 = avg_speed(si::length(140), si::time(2)); #if DOWNCAST_MODE == 0 Speed auto v3 = quantity_cast(v2); #else diff --git a/src/include/units/physical/cgs/acceleration.h b/src/include/units/physical/si/cgs/acceleration.h similarity index 93% rename from src/include/units/physical/cgs/acceleration.h rename to src/include/units/physical/si/cgs/acceleration.h index 9674db81..05824ace 100644 --- a/src/include/units/physical/cgs/acceleration.h +++ b/src/include/units/physical/si/cgs/acceleration.h @@ -23,10 +23,10 @@ #pragma once #include -#include +#include #include -namespace units::physical::cgs { +namespace units::physical::si::cgs { struct gal : named_unit {}; struct dim_acceleration : physical::dim_acceleration {}; @@ -42,4 +42,4 @@ constexpr auto operator"" _q_Gal(long double l) { return acceleration -#include +#include #include #include -namespace units::physical::cgs { +namespace units::physical::si::cgs { using si::square_centimetre; @@ -44,4 +44,4 @@ constexpr auto operator"" _q_cm2(long double l) { return area -#include +#include #include #include -namespace units::physical::cgs { +namespace units::physical::si::cgs { struct erg : named_unit {}; @@ -44,4 +44,4 @@ constexpr auto operator"" _q_erg(long double l) { return energy -#include -#include +#include +#include #include #include -namespace units::physical::cgs { +namespace units::physical::si::cgs { struct dyne : named_unit {}; @@ -45,4 +45,4 @@ constexpr auto operator"" _q_dyn(long double l) { return force #include -namespace units::physical::cgs { +namespace units::physical::si::cgs { using si::centimetre; @@ -43,4 +43,4 @@ constexpr auto operator"" _q_cm(long double l) { return length #include -namespace units::physical::cgs { +namespace units::physical::si::cgs { using si::gram; @@ -43,4 +43,4 @@ constexpr auto operator"" _q_g(long double l) { return mass(l } -} // namespace units::physical::cgs +} // namespace units::physical::si::cgs diff --git a/src/include/units/physical/cgs/power.h b/src/include/units/physical/si/cgs/power.h similarity index 93% rename from src/include/units/physical/cgs/power.h rename to src/include/units/physical/si/cgs/power.h index 2b1b25d7..cec6f445 100644 --- a/src/include/units/physical/cgs/power.h +++ b/src/include/units/physical/si/cgs/power.h @@ -23,11 +23,11 @@ #pragma once #include -#include +#include #include #include -namespace units::physical::cgs { +namespace units::physical::si::cgs { struct erg_per_second : unit {}; @@ -44,4 +44,4 @@ constexpr auto operator"" _q_erg_per_s(long double l) { return power -#include -#include +#include +#include #include #include -namespace units::physical::cgs { +namespace units::physical::si::cgs { struct barye : named_unit {}; @@ -45,4 +45,4 @@ constexpr auto operator"" _q_Ba(long double l) { return pressure -#include -#include +#include +#include #include -namespace units::physical::cgs { +namespace units::physical::si::cgs { struct centimetre_per_second : unit {}; struct dim_speed : physical::dim_speed {}; @@ -43,4 +43,4 @@ constexpr auto operator"" _q_cm_per_s(long double l) { return speed #include -namespace units::physical::cgs { +namespace units::physical::si::cgs { using si::second; @@ -39,4 +39,4 @@ using si::literals::operator"" _q_s; } -} // namespace units::physical::cgs +} // namespace units::physical::si::cgs diff --git a/src/include/units/physical/fps/acceleration.h b/src/include/units/physical/si/fps/acceleration.h similarity index 93% rename from src/include/units/physical/fps/acceleration.h rename to src/include/units/physical/si/fps/acceleration.h index daefef02..5bee6378 100644 --- a/src/include/units/physical/fps/acceleration.h +++ b/src/include/units/physical/si/fps/acceleration.h @@ -23,10 +23,10 @@ #pragma once #include -#include +#include #include -namespace units::physical::fps { +namespace units::physical::si::fps { struct foot_per_second_sq : unit {}; struct dim_acceleration : physical::dim_acceleration {}; @@ -42,4 +42,4 @@ constexpr auto operator"" _q_ft_per_s2(long double l) { return acceleration -#include +#include // #include #include -namespace units::physical::fps { +namespace units::physical::si::fps { struct square_foot : unit {}; struct dim_area : physical::dim_area {}; @@ -44,4 +44,4 @@ constexpr auto operator"" _q_ft2(long double l) { return area -#include -#include +#include +#include #include -namespace units::physical::fps { +namespace units::physical::si::fps { struct pound_per_foot_cub : unit {}; @@ -43,4 +43,4 @@ constexpr auto operator"" _q_lb_per_ft3(long double l) { return density -#include +#include #include #include -namespace units::physical::fps { +namespace units::physical::si::fps { // https://en.wikipedia.org/wiki/Foot-poundal struct foot_poundal : unit {}; @@ -54,4 +54,4 @@ constexpr auto operator"" _q_ft_lbf(long double l) { return energy -#include -#include +#include +#include #include #include -namespace units::physical::fps { +namespace units::physical::si::fps { // https://en.wikipedia.org/wiki/Poundal struct poundal : named_unit {}; @@ -62,4 +62,4 @@ constexpr auto operator"" _q_klbf(long double l) { return force #include -namespace units::physical::fps { +namespace units::physical::si::fps { // https://en.wikipedia.org/wiki/Foot_(unit) struct foot : named_scaled_unit {}; @@ -95,4 +95,4 @@ constexpr auto operator"" _q_naut_mi(long double l) { return length #include -namespace units::physical::fps { +namespace units::physical::si::fps { // https://en.wikipedia.org/wiki/Pound_(mass) struct pound : named_scaled_unit {}; @@ -93,4 +93,4 @@ constexpr auto operator"" _q_lton(long double l) { return mass -#include +#include #include #include -namespace units::physical::fps { +namespace units::physical::si::fps { struct foot_poundal_per_second : unit {}; @@ -57,4 +57,4 @@ constexpr auto operator"" _q_hp(long double l) { return power -#include -#include +#include +#include #include #include -namespace units::physical::fps { +namespace units::physical::si::fps { struct poundal_per_foot_sq : unit {}; @@ -58,4 +58,4 @@ constexpr auto operator"" _q_kpsi(long double l) { return pressure -#include -#include +#include +#include #include -namespace units::physical::fps { +namespace units::physical::si::fps { struct foot_per_second : unit {}; struct dim_speed : physical::dim_speed {}; @@ -56,4 +56,4 @@ constexpr auto operator"" _q_knot(long double l) { return speed #include -namespace units::physical::fps { +namespace units::physical::si::fps { using si::second; using si::minute; @@ -41,4 +41,4 @@ using si::literals::operator"" _q_s; } -} // namespace units::physical::fps +} // namespace units::physical::si::fps diff --git a/src/include/units/physical/fps/volume.h b/src/include/units/physical/si/fps/volume.h similarity index 94% rename from src/include/units/physical/fps/volume.h rename to src/include/units/physical/si/fps/volume.h index 4c6f4e42..37c03175 100644 --- a/src/include/units/physical/fps/volume.h +++ b/src/include/units/physical/si/fps/volume.h @@ -23,10 +23,10 @@ #pragma once #include -#include +#include #include -namespace units::physical::fps { +namespace units::physical::si::fps { struct cubic_foot : unit {}; struct dim_volume : physical::dim_volume {}; @@ -48,4 +48,4 @@ constexpr auto operator"" _q_yd3(long double l) { return volume -namespace units::physical::iau { +namespace units::physical::si::iau { // https://en.wikipedia.org/wiki/Light-year struct light_year : named_scaled_unit {}; @@ -49,4 +49,4 @@ constexpr auto operator"" _q_angstrom(long double l) { return si::length +#include -namespace units::physical::imperial { +namespace units::physical::si::imperial { // https://en.wikipedia.org/wiki/Chain_(unit) -struct chain : named_scaled_unit {}; +struct chain : named_scaled_unit {}; // https://en.wikipedia.org/wiki/Rod_(unit) struct rod : named_scaled_unit {}; @@ -42,4 +42,4 @@ constexpr auto operator"" _q_rd(long double l) { return si::length -#include +#include -namespace units::physical::international { +namespace units::physical::si::international { -struct square_foot : deduced_unit {}; +struct square_foot : deduced_unit {}; inline namespace literals { @@ -37,4 +37,4 @@ constexpr auto operator"" _q_ft2(long double l) { return si::area -namespace units::physical::international { +namespace units::physical::si::international { -// international yard +// si::international yard // https://en.wikipedia.org/wiki/International_yard_and_pound struct yard : named_scaled_unit {}; -// international foot +// si::international foot // https://en.wikipedia.org/wiki/Foot_(unit)#International_foot struct foot : named_scaled_unit {}; // https://en.wikipedia.org/wiki/Fathom#International_fathom struct fathom : named_scaled_unit {}; -// international inch +// si::international inch // https://en.wikipedia.org/wiki/Inch#Equivalences struct inch : named_scaled_unit {}; @@ -46,7 +46,7 @@ struct inch : named_scaled_unit {}; // https://en.wikipedia.org/wiki/Mile#International_mile struct mile : named_scaled_unit {}; -// international nautical mile +// si::international nautical mile // https://en.wikipedia.org/wiki/Nautical_mile struct nautical_mile : named_scaled_unit {}; @@ -94,4 +94,4 @@ constexpr auto operator"" _q_mil(long double l) { return si::length -#include +#include -namespace units::physical::international { +namespace units::physical::si::international { -struct mile_per_hour : deduced_unit {}; +struct mile_per_hour : deduced_unit {}; inline namespace literals { @@ -37,4 +37,4 @@ constexpr auto operator"" _q_mi_per_h(long double l) { return si::speed -#include +#include -namespace units::physical::international { +namespace units::physical::si::international { -struct cubic_foot : deduced_unit {}; +struct cubic_foot : deduced_unit {}; inline namespace literals { @@ -37,4 +37,4 @@ constexpr auto operator"" _q_ft3(long double l) { return si::volume -namespace units::physical::typographic { +namespace units::physical::si::typographic { // TODO Conflicts with (https://en.wikipedia.org/wiki/Pica_(typography)), verify correctness of below conversion factors and provide hyperlinks to definitions struct pica_comp : named_scaled_unit {}; @@ -53,4 +53,4 @@ constexpr auto operator"" _q_point_prn(long double l) { return si::length -namespace units::physical::us { +namespace units::physical::si::us { // https://en.wikipedia.org/wiki/Foot_(unit)#US_survey_foot // https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors#B6 @@ -35,22 +35,22 @@ struct fathom : named_scaled_unit {}; +struct mile : named_scaled_unit {}; inline namespace literals { // ft -constexpr auto operator"" _q_ft_us(unsigned long long l) { return si::length(l); } -constexpr auto operator"" _q_ft_us(long double l) { return si::length(l); } +constexpr auto operator"" _q_ft_us(unsigned long long l) { return si::length(l); } +constexpr auto operator"" _q_ft_us(long double l) { return si::length(l); } // fathom -constexpr auto operator"" _q_fathom_us(unsigned long long l) { return si::length(l); } -constexpr auto operator"" _q_fathom_us(long double l) { return si::length(l); } +constexpr auto operator"" _q_fathom_us(unsigned long long l) { return si::length(l); } +constexpr auto operator"" _q_fathom_us(long double l) { return si::length(l); } // ft -constexpr auto operator"" _q_mi_us(unsigned long long l) { return si::length(l); } -constexpr auto operator"" _q_mi_us(long double l) { return si::length(l); } +constexpr auto operator"" _q_mi_us(unsigned long long l) { return si::length(l); } +constexpr auto operator"" _q_mi_us(long double l) { return si::length(l); } } // namespace literals -} // namespace units::physical::us +} // namespace units::physical::si::us diff --git a/test/unit_test/runtime/fmt_test.cpp b/test/unit_test/runtime/fmt_test.cpp index 9cf6576e..bc434ff1 100644 --- a/test/unit_test/runtime/fmt_test.cpp +++ b/test/unit_test/runtime/fmt_test.cpp @@ -20,18 +20,18 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -#include "units/physical/cgs/length.h" -#include "units/physical/cgs/mass.h" +#include "units/format.h" +#include "units/math.h" #include "units/physical/si/area.h" +#include "units/physical/si/cgs/length.h" +#include "units/physical/si/cgs/mass.h" #include "units/physical/si/frequency.h" #include "units/physical/si/power.h" #include "units/physical/si/pressure.h" -#include "units/physical/si/speed.h" -#include "units/physical/si/volume.h" -#include "units/physical/si/surface_tension.h" #include "units/physical/si/resistance.h" -#include "units/format.h" -#include "units/math.h" +#include "units/physical/si/speed.h" +#include "units/physical/si/surface_tension.h" +#include "units/physical/si/volume.h" #include #include #include @@ -518,7 +518,7 @@ TEST_CASE("operator<< on a quantity", "[text][ostream][fmt]") SECTION("CGS base units") { - const auto q = 2._q_s * cgs::length(2) * cgs::mass(2); + const auto q = 2._q_s * si::cgs::length(2) * si::cgs::mass(2); os << q; SECTION("iostream") @@ -603,7 +603,7 @@ TEST_CASE("operator<< on a quantity", "[text][ostream][fmt]") SECTION("CGS base units") { - const auto q = 2._q_s * cgs::length(2) * cgs::mass(2); + const auto q = 2._q_s * si::cgs::length(2) * si::cgs::mass(2); os << q; SECTION("iostream") diff --git a/test/unit_test/runtime/fmt_units_test.cpp b/test/unit_test/runtime/fmt_units_test.cpp index 178d1742..010c496b 100644 --- a/test/unit_test/runtime/fmt_units_test.cpp +++ b/test/unit_test/runtime/fmt_units_test.cpp @@ -20,24 +20,24 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -#include "units/physical/si.h" -#include "units/physical/us/length.h" -#include "units/physical/imperial/length.h" -#include "units/physical/international/length.h" -#include "units/physical/international/area.h" -#include "units/physical/international/volume.h" -#include "units/physical/international/speed.h" -#include "units/physical/iau/length.h" -#include "units/physical/typographic/length.h" #include "units/format.h" +#include "units/physical/si.h" +#include "units/physical/si/iau/length.h" +#include "units/physical/si/imperial/length.h" +#include "units/physical/si/international/area.h" +#include "units/physical/si/international/length.h" +#include "units/physical/si/international/speed.h" +#include "units/physical/si/international/volume.h" +#include "units/physical/si/typographic/length.h" +#include "units/physical/si/us/length.h" #include using namespace units::physical::si; -using namespace units::physical::international; -using namespace units::physical::us; -using namespace units::physical::iau; -using namespace units::physical::imperial; -using namespace units::physical::typographic; +using namespace units::physical::si::international; +using namespace units::physical::si::us; +using namespace units::physical::si::iau; +using namespace units::physical::si::imperial; +using namespace units::physical::si::typographic; TEST_CASE("fmt::format on synthesized unit symbols", "[text][fmt]") { diff --git a/test/unit_test/static/cgs_test.cpp b/test/unit_test/static/cgs_test.cpp index 1215bb83..5d775349 100644 --- a/test/unit_test/static/cgs_test.cpp +++ b/test/unit_test/static/cgs_test.cpp @@ -20,21 +20,20 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. - -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace { using namespace units; -using namespace units::physical::cgs; +using namespace units::physical::si::cgs; /* ************** BASE DIMENSIONS **************** */ diff --git a/test/unit_test/static/fps_test.cpp b/test/unit_test/static/fps_test.cpp index fc34dfa0..ce73a6cd 100644 --- a/test/unit_test/static/fps_test.cpp +++ b/test/unit_test/static/fps_test.cpp @@ -20,21 +20,20 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. - -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace { using namespace units; -using namespace units::physical::fps; +using namespace units::physical::si::fps; /* ************** BASE DIMENSIONS **************** */ diff --git a/test/unit_test/static/math_test.cpp b/test/unit_test/static/math_test.cpp index 1c120496..d9e0fec3 100644 --- a/test/unit_test/static/math_test.cpp +++ b/test/unit_test/static/math_test.cpp @@ -20,19 +20,17 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include "units/math.h" #include "test_tools.h" -#include "units/math.h" -#include "units/physical/international/area.h" #include "units/physical/si/area.h" +#include "units/physical/si/international/area.h" #include "units/physical/si/speed.h" -#include "units/physical/international/area.h" -#include "units/math.h" namespace { using namespace units; using namespace units::physical::si::literals; -using namespace units::physical::international::literals; +using namespace units::physical::si::international::literals; static_assert(compare(2_q_m)), std::int64_t>); static_assert(compare(2_q_m)), decltype(2_q_m)>); diff --git a/test/unit_test/static/quantity_point_test.cpp b/test/unit_test/static/quantity_point_test.cpp index edd56f7f..6ce7b6fd 100644 --- a/test/unit_test/static/quantity_point_test.cpp +++ b/test/unit_test/static/quantity_point_test.cpp @@ -20,14 +20,14 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include "units/quantity_point.h" #include "test_tools.h" #include "units/math.h" #include "units/physical/si/area.h" #include "units/physical/si/frequency.h" #include "units/physical/si/speed.h" +#include "units/physical/si/us/length.h" #include "units/physical/si/volume.h" -#include "units/physical/us/length.h" -#include "units/quantity_point.h" #include #include @@ -200,7 +200,7 @@ static_assert(compare); static_assert(std::equality_comparable_with); diff --git a/test/unit_test/static/quantity_test.cpp b/test/unit_test/static/quantity_test.cpp index df3623db..20fa80ca 100644 --- a/test/unit_test/static/quantity_test.cpp +++ b/test/unit_test/static/quantity_test.cpp @@ -25,8 +25,8 @@ #include "units/physical/si/area.h" #include "units/physical/si/frequency.h" #include "units/physical/si/speed.h" +#include "units/physical/si/us/length.h" #include "units/physical/si/volume.h" -#include "units/physical/us/length.h" #include #include @@ -261,7 +261,7 @@ static_assert( // common_type -using namespace units::physical::us::literals; +using namespace units::physical::si::us::literals; static_assert(std::equality_comparable); static_assert(std::equality_comparable_with); diff --git a/test/unit_test/static/si_cgs_test.cpp b/test/unit_test/static/si_cgs_test.cpp index f236eff9..b6729927 100644 --- a/test/unit_test/static/si_cgs_test.cpp +++ b/test/unit_test/static/si_cgs_test.cpp @@ -20,69 +20,68 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include #include #include -#include #include +#include namespace { using namespace units::physical; static_assert(units::detail::quantity_ratio(si::length(1)) == units::ratio(1)); -static_assert(units::detail::quantity_ratio(cgs::length(1)) == units::ratio(1, 100)); +static_assert(units::detail::quantity_ratio(si::cgs::length(1)) == units::ratio(1, 100)); static_assert(units::detail::quantity_ratio(si::speed(1)) == units::ratio(1)); -static_assert(units::detail::quantity_ratio(cgs::speed(1)) == units::ratio(1, 100)); +static_assert(units::detail::quantity_ratio(si::cgs::speed(1)) == units::ratio(1, 100)); static_assert(units::detail::quantity_ratio(si::force(1)) == units::ratio(1000)); // defined in terms of kilogram that are 1000 * gram -static_assert(units::detail::quantity_ratio(cgs::force(1)) == units::ratio(1, 100)); // defined in terms of gram so only centimetre ratio counts here +static_assert(units::detail::quantity_ratio(si::cgs::force(1)) == units::ratio(1, 100)); // defined in terms of gram so only centimetre ratio counts here -static_assert(cgs::length(100) == si::length(1)); -static_assert(cgs::mass(1'000) == si::mass(1)); -static_assert(cgs::time(1) == si::time(1)); -static_assert(cgs::speed(100) == si::speed(1)); -static_assert(cgs::area(10000) == si::area(1)); -static_assert(cgs::acceleration(100) == si::acceleration(1)); -static_assert(cgs::force(100'000) == si::force(1)); -static_assert(cgs::energy(10'000'000) == si::energy(1)); -static_assert(cgs::power(10'000'000) == si::power(1)); -static_assert(cgs::pressure(10) == si::pressure(1)); +static_assert(si::cgs::length(100) == si::length(1)); +static_assert(si::cgs::mass(1'000) == si::mass(1)); +static_assert(si::cgs::time(1) == si::time(1)); +static_assert(si::cgs::speed(100) == si::speed(1)); +static_assert(si::cgs::area(10000) == si::area(1)); +static_assert(si::cgs::acceleration(100) == si::acceleration(1)); +static_assert(si::cgs::force(100'000) == si::force(1)); +static_assert(si::cgs::energy(10'000'000) == si::energy(1)); +static_assert(si::cgs::power(10'000'000) == si::power(1)); +static_assert(si::cgs::pressure(10) == si::pressure(1)); namespace si_test { using namespace units::physical::si::literals; -static_assert(cgs::length(100) == 1_q_m); -static_assert(cgs::mass(1'000) == 1_q_kg); -static_assert(cgs::time(1) == 1_q_s); -static_assert(cgs::speed(100) == 1_q_m_per_s); -static_assert(cgs::acceleration(100) == 1_q_m_per_s2); -static_assert(cgs::force(100'000) == 1_q_N); -static_assert(cgs::energy(10'000'000) == 1_q_J); -static_assert(cgs::power(10'000'000) == 1_q_W); -static_assert(cgs::pressure(10) == 1_q_Pa); +static_assert(si::cgs::length(100) == 1_q_m); +static_assert(si::cgs::mass(1'000) == 1_q_kg); +static_assert(si::cgs::time(1) == 1_q_s); +static_assert(si::cgs::speed(100) == 1_q_m_per_s); +static_assert(si::cgs::acceleration(100) == 1_q_m_per_s2); +static_assert(si::cgs::force(100'000) == 1_q_N); +static_assert(si::cgs::energy(10'000'000) == 1_q_J); +static_assert(si::cgs::power(10'000'000) == 1_q_W); +static_assert(si::cgs::pressure(10) == 1_q_Pa); } namespace cgs_test { -using namespace units::physical::cgs::literals; +using namespace units::physical::si::cgs::literals; static_assert(100_q_cm == si::length(1)); static_assert(1'000_q_g == si::mass(1)); @@ -99,7 +98,7 @@ static_assert(10_q_Ba == si::pressure(1)); namespace both_test { using namespace units::physical::si::literals; -using namespace units::physical::cgs::literals; +using namespace units::physical::si::cgs::literals; // static_assert(100_q_cm == 1_q_m); // ambiguous // static_assert(1'000_q_g == 1_q_kg); // ambiguous @@ -121,8 +120,8 @@ namespace cgs_test { // static_assert(si::length(1) + 100_q_cm == si::length(2)); // should not compile (different dimensions) static_assert(quantity_cast>(100_q_cm) + si::length(1) == si::length(2)); static_assert(si::length(1) + quantity_cast>(100_q_cm) == si::length(2)); -static_assert(100_q_cm + quantity_cast>(si::length(1)) == 200_q_cm); -static_assert(quantity_cast>(si::length(1)) + 100_q_cm == 200_q_cm); +static_assert(100_q_cm + quantity_cast>(si::length(1)) == 200_q_cm); +static_assert(quantity_cast>(si::length(1)) + 100_q_cm == 200_q_cm); // substraction @@ -130,28 +129,28 @@ static_assert(quantity_cast>(si::length( // static_assert(si::length(5) - 100_q_cm == si::length(4)); // should not compile (different dimensions) static_assert(quantity_cast>(500_q_cm) - si::length(1) == si::length(4)); static_assert(si::length(5) - quantity_cast>(100_q_cm) == si::length(4)); -static_assert(500_q_cm - quantity_cast>(si::length(1)) == 400_q_cm); -static_assert(quantity_cast>(si::length(5)) - 100_q_cm == 400_q_cm); +static_assert(500_q_cm - quantity_cast>(si::length(1)) == 400_q_cm); +static_assert(quantity_cast>(si::length(5)) - 100_q_cm == 400_q_cm); // multiplication // static_assert(200_q_cm * si::length(2) == si::area(4)); // should not compile (unknown dimension) static_assert(quantity_cast(200._q_cm) * si::length(2) == si::area(4)); -static_assert(200._q_cm * quantity_cast(si::length(2)) == 40'000_q_cm2); +static_assert(200._q_cm * quantity_cast(si::length(2)) == 40'000_q_cm2); // TODO Add support for quantity_cast on an unknown_dimension? // static_assert(quantity_cast>(200_q_cm * si::length(2)) == si::area(4)); // static_assert(quantity_cast(200_q_cm * si::length(2)) == si::area(4)); -// static_assert(quantity_cast>(200_q_cm * si::length(2)) == 40'000_q_cm2); -// static_assert(quantity_cast(200_q_cm * si::length(2)) == 40'000_q_cm2); +// static_assert(quantity_cast>(200_q_cm * si::length(2)) == 40'000_q_cm2); +// static_assert(quantity_cast(200_q_cm * si::length(2)) == 40'000_q_cm2); // division // static_assert(si::area(4) / 200_q_cm == si::length(2)); // should not compile (unknown dimension) static_assert(si::area(4) / quantity_cast>(200_q_cm) == si::length(2)); -static_assert(quantity_cast>(si::area(4)) / 200._q_cm == 200_q_cm); +static_assert(quantity_cast>(si::area(4)) / 200._q_cm == 200_q_cm); } diff --git a/test/unit_test/static/si_fps_test.cpp b/test/unit_test/static/si_fps_test.cpp index 20062022..d0c2b387 100644 --- a/test/unit_test/static/si_fps_test.cpp +++ b/test/unit_test/static/si_fps_test.cpp @@ -20,70 +20,69 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include -#include #include +#include namespace { using namespace units::physical; -static_assert(fps::length(1) == si::length(0.3048)); -static_assert(fps::mass(1) == si::mass(0.45359237)); -static_assert(fps::time(1) == si::time(1)); -static_assert(fps::speed(1) == si::speed(0.3048)); -static_assert(fps::area(1) == si::area(0.09290304)); -static_assert(fps::acceleration(1) == si::acceleration(0.3048)); -static_assert(fps::force(1) > si::force(0.138254) && - fps::force(1) < si::force(0.138256)); -static_assert(fps::energy(1) > si::energy(0.042140110093804) && - fps::energy(1) < si::energy(0.042140110093806)); -static_assert(fps::power(1) > si::power(0.042140110093804) && - fps::power(1) < si::power(0.042140110093806)); -static_assert(fps::pressure(1) > si::pressure(1.4881639435) && - fps::pressure(1) < si::pressure(1.4881639437)); +static_assert(si::fps::length(1) == si::length(0.3048)); +static_assert(si::fps::mass(1) == si::mass(0.45359237)); +static_assert(si::fps::time(1) == si::time(1)); +static_assert(si::fps::speed(1) == si::speed(0.3048)); +static_assert(si::fps::area(1) == si::area(0.09290304)); +static_assert(si::fps::acceleration(1) == si::acceleration(0.3048)); +static_assert(si::fps::force(1) > si::force(0.138254) && + si::fps::force(1) < si::force(0.138256)); +static_assert(si::fps::energy(1) > si::energy(0.042140110093804) && + si::fps::energy(1) < si::energy(0.042140110093806)); +static_assert(si::fps::power(1) > si::power(0.042140110093804) && + si::fps::power(1) < si::power(0.042140110093806)); +static_assert(si::fps::pressure(1) > si::pressure(1.4881639435) && + si::fps::pressure(1) < si::pressure(1.4881639437)); namespace si_literals { using namespace units::physical::si::literals; -static_assert(fps::length(1) == 0.3048_q_m); -static_assert(fps::mass(1) == 0.45359237_q_kg); -static_assert(fps::time(1) == 1_q_s); -static_assert(fps::speed(1) == 0.3048_q_m_per_s); -static_assert(fps::area(1) == 0.09290304_q_m2); -static_assert(fps::acceleration(1) == 0.3048_q_m_per_s2); -static_assert(fps::force(1) > 0.138254_q_N && - fps::force(1) < 0.138256_q_N); -static_assert(fps::energy(1) > 0.042140110093804_q_J && - fps::energy(1) < 0.042140110093806_q_J); -static_assert(fps::power(1) > 0.042140110093804_q_W && - fps::power(1) < 0.042140110093806_q_W); -static_assert(fps::pressure(1) > 1.4881639435_q_Pa && - fps::pressure(1) < 1.4881639437_q_Pa); +static_assert(si::fps::length(1) == 0.3048_q_m); +static_assert(si::fps::mass(1) == 0.45359237_q_kg); +static_assert(si::fps::time(1) == 1_q_s); +static_assert(si::fps::speed(1) == 0.3048_q_m_per_s); +static_assert(si::fps::area(1) == 0.09290304_q_m2); +static_assert(si::fps::acceleration(1) == 0.3048_q_m_per_s2); +static_assert(si::fps::force(1) > 0.138254_q_N && + si::fps::force(1) < 0.138256_q_N); +static_assert(si::fps::energy(1) > 0.042140110093804_q_J && + si::fps::energy(1) < 0.042140110093806_q_J); +static_assert(si::fps::power(1) > 0.042140110093804_q_W && + si::fps::power(1) < 0.042140110093806_q_W); +static_assert(si::fps::pressure(1) > 1.4881639435_q_Pa && + si::fps::pressure(1) < 1.4881639437_q_Pa); } namespace fps_literals { -using namespace units::physical::fps::literals; +using namespace units::physical::si::fps::literals; static_assert(1_q_ft == si::length(0.3048)); static_assert(1_q_lb == si::mass(0.45359237)); @@ -104,7 +103,7 @@ static_assert(1_q_pdl_per_ft2> si::pressure(1.4881639435) && namespace fps_plus_si_literals { using namespace units::physical::si::literals; -using namespace units::physical::fps::literals; +using namespace units::physical::si::fps::literals; // static_assert(100_q_cm == 1_q_m); // ambiguous // static_assert(1'000_q_g == 1_q_kg); // ambiguous @@ -125,9 +124,9 @@ static_assert(1_q_pdl_per_ft2> 1.4881639435_q_Pa && } -namespace cgs_test { +namespace fps_test { -using namespace units::physical::fps::literals; +using namespace units::physical::si::fps::literals; // addition @@ -135,8 +134,8 @@ using namespace units::physical::fps::literals; // static_assert(1_q_ft / 0.3048 + si::length(1) == si::length(1.3048)); // should not compile (different dimensions) static_assert(quantity_cast>(1._q_ft / 0.3048) + si::length(1) == si::length(2)); // 1 m in ft + 1 m static_assert(si::length(1) + quantity_cast>(1._q_ft / 0.3048) == si::length(2)); // 1 m + 1 m in ft -static_assert(1_q_ft + quantity_cast>(si::length(0.3048)) == 2_q_ft); // 1 ft + 1 ft in m -static_assert(quantity_cast>(si::length(0.3048)) + 1_q_ft == 2_q_ft); // 1 ft in m + 1 ft +static_assert(1_q_ft + quantity_cast>(si::length(0.3048)) == 2_q_ft); // 1 ft + 1 ft in m +static_assert(quantity_cast>(si::length(0.3048)) + 1_q_ft == 2_q_ft); // 1 ft in m + 1 ft // substraction @@ -145,21 +144,21 @@ static_assert(quantity_cast>(si::length(0.3048 static_assert(quantity_cast>(6._q_ft) - si::length(1) > si::length(0.8287) && quantity_cast>(6._q_ft) - si::length(1) < si::length(0.8289)); // 6 ft in m - 1 m = ... m static_assert(si::length(5) - quantity_cast>(6_q_ft) == si::length(3.1712)); // 5 m - 6 ft in m = ... -static_assert(6._q_ft - quantity_cast>(si::length(0.3048)) == 5._q_ft); // 6 ft - 1 ft in m = 5 ft -static_assert(quantity_cast>(si::length(1.8288)) - 1._q_ft == 5._q_ft); // 6 ft in m - 1 ft = 5 ft +static_assert(6._q_ft - quantity_cast>(si::length(0.3048)) == 5._q_ft); // 6 ft - 1 ft in m = 5 ft +static_assert(quantity_cast>(si::length(1.8288)) - 1._q_ft == 5._q_ft); // 6 ft in m - 1 ft = 5 ft // multiplication // static_assert(2_q_ft * si::length(2) == si::area(1.2192)); // should not compile (unknown dimension) // static_assert(quantity_cast>(2._q_ft) * si::length(2) == si::area(1.2192)); static_assert(quantity_cast>(2._q_ft) * si::length(0.6096) == si::area(0.371612160)); // 2 ft * 2 ft == 4 sq ft -static_assert(2._q_ft * quantity_cast>(si::length(0.6096)) == 4._q_ft2); +static_assert(2._q_ft * quantity_cast>(si::length(0.6096)) == 4._q_ft2); // division // static_assert(si::area(4) / 200_q_cm == si::length(2)); // should not compile (unknown dimension) static_assert(si::area(1.48644864) / quantity_cast>(4_q_ft) == si::length(1.2192)); // 16 ft2 / 4 ft = 4 ft -static_assert(quantity_cast>(si::area(1.48644864)) / 4._q_ft == 4._q_ft); // 16 ft2 / 4 ft = 4 ft +static_assert(quantity_cast>(si::area(1.48644864)) / 4._q_ft == 4._q_ft); // 16 ft2 / 4 ft = 4 ft } diff --git a/test/unit_test/static/us_test.cpp b/test/unit_test/static/us_test.cpp index ae086406..2bbc6854 100644 --- a/test/unit_test/static/us_test.cpp +++ b/test/unit_test/static/us_test.cpp @@ -21,22 +21,22 @@ // SOFTWARE. #include +#include +#include +#include +#include #include -#include #include +#include #include -#include -#include -#include -#include #include namespace { using namespace units; using namespace units::physical::si; -using namespace units::physical::us; -using namespace units::physical::international; +using namespace units::physical::si::us; +using namespace units::physical::si::international; /* ************** BASE DIMENSIONS **************** */