diff --git a/README.md b/README.md index ccaf92f5..d9443a3f 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,6 @@ analysis and unit/quantity manipulation. The basic idea and design heavily bases Here is a small example of possible operations: ```cpp -#define UNITS_REFERENCES - #include #include #include @@ -58,7 +56,7 @@ static_assert(10 * km / (5 * km) == 2); static_assert(1000 / (1 * s) == 1 * kHz); ``` -_Try it on the [Compiler Explorer](https://godbolt.org/z/53bTahKd8)._ +_Try it on the [Compiler Explorer](https://godbolt.org/z/5dvY8Woh1)._ This library requires some C++20 features (concepts, classes as NTTPs, ...). Thanks to them the user gets a powerful but still easy to use interface and all unit conversions @@ -66,10 +64,6 @@ and dimensional analysis can be performed without sacrificing on accuracy. Pleas the below example for a quick preview of basic library features: ```cpp -#define UNITS_ALIASES -#define UNITS_LITERALS -#define UNITS_REFERENCES - #include #include #include @@ -115,4 +109,4 @@ int main() } ``` -_Try it on the [Compiler Explorer](https://godbolt.org/z/jKnPPPEx6)._ +_Try it on the [Compiler Explorer](https://godbolt.org/z/9fnzfbhb6)._ diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 04f81942..97b01415 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -6,7 +6,6 @@ - (!) refactor: Refactored the library file tree - (!) refactor: `quantity::count()` renamed to `quantity::number()` - (!) refactor: `data` system renamed to `isq::iec80000` (quantity names renamed too) - - (!) refactor: quantity UDLs support has to be enabled with `UNITS_LITERALS` preprocessor define - refactor: quantity (kind) point updated to reflect latest changes to `quantity` - refactor: basic concepts, `quantity` and `quantity_cast` refactored - refactor: `abs()` definition refactored to be more explicit about the return type @@ -17,6 +16,7 @@ - feat: CTAD for dimensionless quantity added - feat: `modulation_rate` support added (thanks [@go2sh](https://github.com/go2sh)) - feat: SI prefixes for `isq::iec80000` support added (thanks [@go2sh](https://github.com/go2sh)) + - feat: a possibility to disable quantity UDLs support with `UNITS_NO_LITERALS` preprocessor define - perf: preconditions check do not influence the runtime performance of a Release build - perf: `quantity_cast()` generates less assembly instructions - perf: temporary string creation removed from `quantity::op<<()` diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in index ce627992..9dec7d17 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.in @@ -91,15 +91,3 @@ WARN_AS_ERROR = NO # The default value is: NO. QUIET = YES - -# The PREDEFINED tag can be used to specify one or more macro names that are -# defined before the preprocessor is started (similar to the -D option of e.g. -# gcc). The argument of the tag is a list of macros of the form: name or -# name=definition (no spaces). If the definition and the "=" are omitted, "=1" -# is assumed. To prevent a macro definition from being undefined via #undef or -# recursively expanded use the := operator instead of the = operator. -# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. - -PREDEFINED = UNITS_REFERENCES \ - UNITS_LITERALS \ - UNITS_ALIASES diff --git a/docs/framework/quantities.rst b/docs/framework/quantities.rst index 23786c50..ea880ac2 100644 --- a/docs/framework/quantities.rst +++ b/docs/framework/quantities.rst @@ -70,7 +70,7 @@ Unit-Specific Aliases (Experimental) Additionally to the dimension-specific aliases there are also ones provided for each and every :term:`unit` in the library:: - #ifdef UNITS_ALIASES + #ifndef UNITS_NO_ALIASES namespace units::aliases::isq::si::inline length { @@ -86,7 +86,7 @@ each and every :term:`unit` in the library:: } - #endif // UNITS_ALIASES + #endif // UNITS_NO_ALIASES Using the above our code can look as follows:: @@ -116,7 +116,7 @@ Quantity References (Experimental) Quantity References provide an alternative and simplified way to create quantities. They are defined using the `reference` class template:: - #ifdef UNITS_REFERENCES + #ifndef UNITS_NO_REFERENCES namespace length_references { @@ -131,7 +131,7 @@ They are defined using the `reference` class template:: } // namespace references - #endif // UNITS_REFERENCES + #endif // UNITS_NO_REFERENCES With the above our code can look as follows:: @@ -157,7 +157,7 @@ User Defined Literals (Experimental) Alternatively, to construct quantities with compile-time known values the library provides :abbr:`UDL (User Defined Literal)` s for each :term:`unit` of every :term:`dimension`:: - #ifdef UNITS_LITERALS + #ifndef UNITS_NO_LITERALS inline namespace literals { @@ -169,7 +169,7 @@ Alternatively, to construct quantities with compile-time known values the librar } - #endif // UNITS_LITERALS + #endif // UNITS_NO_LITERALS Thanks to them the same code can be as simple as:: @@ -185,13 +185,6 @@ Thanks to them the same code can be as simple as:: language (i.e. ``F`` (farad), ``J`` (joule), ``W`` (watt), ``K`` (kelvin), ``d`` (day), ``l`` or ``L`` (litre), ``erg``, ``ergps``). This is why the ``_q_`` prefix was consistently applied to all the UDLs. - -.. important:: - - As one can read in the next section UDLs, are considered to be inferior to `Quantity References`_ - and their definition affects compile-time performance a lot. This is why they are an opt-in feature - of the library and in order to use them one has to provide a `UNITS_LITERALS` preprocessor definition. - UDLs vs Quantity References +++++++++++++++++++++++++++ @@ -473,6 +466,19 @@ Summary +-----------------------------------------------+-------------+------------+---------------+ +Don't pay for what you don't use (compile-time performance) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +As noted in the previous chapter, each quantity creation helper has a different impact on the compile-time +performance. Aliases tend to be the fastest to compile but even their definition can be expensive for some +if it is not used in the source code. This is why it is possible to opt-out from each or every quantity +creation helper with the following preprocessor defines:: + + #define UNITS_NO_ALIASES + #define UNITS_NO_REFERENCES + #define UNITS_NO_LITERALS + + Dimension-specific Concepts --------------------------- diff --git a/docs/quick_start.rst b/docs/quick_start.rst index cced0d9b..54168803 100644 --- a/docs/quick_start.rst +++ b/docs/quick_start.rst @@ -3,8 +3,6 @@ Quick Start Here is a small example of possible operations:: - #define UNITS_REFERENCES - #include #include #include @@ -34,7 +32,7 @@ Here is a small example of possible operations:: .. admonition:: Try it on Compiler Explorer - `Example #1 `_ + `Example #1 `_ This library requires some C++20 features (concepts, classes as :abbr:`NTTP (Non-Type Template Parameter)`, ...). Thanks to them the user gets a powerful @@ -42,10 +40,6 @@ but still easy to use interface where all unit conversions and dimensional analy performed without sacrificing on accuracy. Please see the below example for a quick preview of basic library features:: - #define UNITS_ALIASES - #define UNITS_LITERALS - #define UNITS_REFERENCES - #include #include #include @@ -92,7 +86,7 @@ of basic library features:: .. admonition:: Try it on Compiler Explorer - `Example #2 `_ + `Example #2 `_ .. seealso:: diff --git a/example/aliases/CMakeLists.txt b/example/aliases/CMakeLists.txt index a65f3e4d..331b6a84 100644 --- a/example/aliases/CMakeLists.txt +++ b/example/aliases/CMakeLists.txt @@ -28,7 +28,10 @@ cmake_minimum_required(VERSION 3.2) function(add_example target) add_executable(${target}-aliases ${target}.cpp) target_link_libraries(${target}-aliases PRIVATE ${ARGN}) - target_compile_definitions(${target}-aliases PRIVATE UNITS_ALIASES) + target_compile_definitions(${target}-aliases PRIVATE + UNITS_NO_LITERALS + UNITS_NO_REFERENCES + ) endfunction() add_example(avg_speed mp-units::core-io mp-units::si mp-units::si-cgs mp-units::si-international) @@ -43,7 +46,10 @@ add_example(unknown_dimension mp-units::core-io mp-units::si) if(NOT UNITS_LIBCXX) add_example(glide_computer_example mp-units::core-fmt mp-units::si-international glide_computer) - target_compile_definitions(glide_computer_example-aliases PRIVATE UNITS_REFERENCES) + target_compile_definitions(glide_computer_example-aliases PRIVATE + UNITS_NO_LITERALS + UNITS_NO_REFERENCES + ) find_package(linear_algebra CONFIG REQUIRED) add_example(linear_algebra mp-units::core-fmt mp-units::core-io mp-units::si) diff --git a/example/hello_units.cpp b/example/hello_units.cpp index f7b22988..ec1713fa 100644 --- a/example/hello_units.cpp +++ b/example/hello_units.cpp @@ -20,10 +20,6 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -#define UNITS_ALIASES -#define UNITS_LITERALS -#define UNITS_REFERENCES - #include #include #include // IWYU pragma: keep diff --git a/example/kalman_filter/CMakeLists.txt b/example/kalman_filter/CMakeLists.txt index 2ee45504..d170256a 100644 --- a/example/kalman_filter/CMakeLists.txt +++ b/example/kalman_filter/CMakeLists.txt @@ -28,7 +28,10 @@ cmake_minimum_required(VERSION 3.2) function(add_example target) add_executable(${target} ${target}.cpp) target_link_libraries(${target} PRIVATE ${ARGN}) - target_compile_definitions(${target} PRIVATE UNITS_REFERENCES) + target_compile_definitions(${target} PRIVATE + UNITS_NO_LITERALS + UNITS_NO_ALIASES + ) endfunction() add_example(kalman_filter-example_1 mp-units::core-fmt mp-units::si) diff --git a/example/literals/CMakeLists.txt b/example/literals/CMakeLists.txt index 8ac70781..676c8296 100644 --- a/example/literals/CMakeLists.txt +++ b/example/literals/CMakeLists.txt @@ -28,7 +28,10 @@ cmake_minimum_required(VERSION 3.2) function(add_example target) add_executable(${target}-literals ${target}.cpp) target_link_libraries(${target}-literals PRIVATE ${ARGN}) - target_compile_definitions(${target}-literals PRIVATE UNITS_LITERALS) + target_compile_definitions(${target}-literals PRIVATE + UNITS_NO_REFERENCES + UNITS_NO_ALIASES + ) endfunction() add_example(avg_speed mp-units::core-io mp-units::si mp-units::si-cgs mp-units::si-international) @@ -42,7 +45,10 @@ add_example(unknown_dimension mp-units::core-io mp-units::si) if(NOT UNITS_LIBCXX) add_example(glide_computer_example mp-units::core-fmt mp-units::si-international glide_computer) - target_compile_definitions(glide_computer_example-literals PRIVATE UNITS_LITERALS) + target_compile_definitions(glide_computer_example-literals PRIVATE + UNITS_NO_REFERENCES + UNITS_NO_ALIASES + ) find_package(linear_algebra CONFIG REQUIRED) add_example(linear_algebra mp-units::core-fmt mp-units::core-io mp-units::si) diff --git a/example/references/CMakeLists.txt b/example/references/CMakeLists.txt index b7cb5c65..56054880 100644 --- a/example/references/CMakeLists.txt +++ b/example/references/CMakeLists.txt @@ -28,7 +28,10 @@ cmake_minimum_required(VERSION 3.2) function(add_example target) add_executable(${target}-references ${target}.cpp) target_link_libraries(${target}-references PRIVATE ${ARGN}) - target_compile_definitions(${target}-references PRIVATE UNITS_REFERENCES) + target_compile_definitions(${target}-references PRIVATE + UNITS_NO_LITERALS + UNITS_NO_ALIASES + ) endfunction() add_example(avg_speed mp-units::core-io mp-units::si mp-units::si-cgs mp-units::si-international) @@ -42,7 +45,10 @@ add_example(unknown_dimension mp-units::core-io mp-units::si) if(NOT UNITS_LIBCXX) add_example(glide_computer_example mp-units::core-fmt mp-units::si-international glide_computer) - target_compile_definitions(glide_computer_example-references PRIVATE UNITS_REFERENCES) + target_compile_definitions(glide_computer_example-references PRIVATE + UNITS_NO_LITERALS + UNITS_NO_ALIASES + ) find_package(linear_algebra CONFIG REQUIRED) add_example(linear_algebra mp-units::core-fmt mp-units::core-io mp-units::si) diff --git a/src/core/include/units/generic/angle.h b/src/core/include/units/generic/angle.h index 76bd1f51..00c723dc 100644 --- a/src/core/include/units/generic/angle.h +++ b/src/core/include/units/generic/angle.h @@ -43,7 +43,7 @@ concept Angle = QuantityOfT; template> U, Representation Rep = double> using angle = quantity, U, Rep>; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -53,9 +53,9 @@ constexpr auto operator"" _q_rad(long double l) { return angle U, Representation Rep = double> using modulation_rate = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -66,9 +66,9 @@ constexpr auto operator"" _q_YBd(unsigned long long l) { gsl_ExpectsAudit(std::i } // namespace literals -#endif // UNITS_LITERALS +#endif // UNITS_NO_LITERALS -#ifdef UNITS_REFERENCES +#ifndef UNITS_NO_REFERENCES namespace modulation_rate_references { @@ -90,11 +90,11 @@ using namespace modulation_rate_references; } // namespace references -#endif // UNITS_REFERENCES +#endif // UNITS_NO_REFERENCES } // namespace units::isq::iec80000 -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::iec80000::inline modulation_rate { @@ -110,4 +110,4 @@ template using YBd = units::isq::iec80000::modulati } // namespace units::aliases::isq::iec80000::inline modulation_rate -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/isq-iec80000/include/units/isq/iec80000/storage_capacity.h b/src/systems/isq-iec80000/include/units/isq/iec80000/storage_capacity.h index 7a6e6cd5..7b1c0a2f 100644 --- a/src/systems/isq-iec80000/include/units/isq/iec80000/storage_capacity.h +++ b/src/systems/isq-iec80000/include/units/isq/iec80000/storage_capacity.h @@ -79,7 +79,7 @@ concept StorageCapacity = QuantityOf; template U, Representation Rep = double> using storage_capacity = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -123,9 +123,9 @@ constexpr auto operator"" _q_PiB(unsigned long long l) { gsl_ExpectsAudit(std::i } // namespace literals -#endif // UNITS_LITERALS +#endif // UNITS_NO_LITERALS -#ifdef UNITS_REFERENCES +#ifndef UNITS_NO_REFERENCES namespace storage_capacity_references { @@ -175,11 +175,11 @@ using namespace storage_capacity_references; } // namespace references -#endif // UNITS_REFERENCES +#endif // UNITS_NO_REFERENCES } // namespace units::isq::iec80000 -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::iec80000::inline storage_capacity { @@ -223,4 +223,4 @@ template using PiB = units::isq::iec80000::storage_ } // namespace units::aliases::isq::iec80000::inline storage_capacity -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/isq-iec80000/include/units/isq/iec80000/traffic_intensity.h b/src/systems/isq-iec80000/include/units/isq/iec80000/traffic_intensity.h index 541aa505..15b4fa18 100644 --- a/src/systems/isq-iec80000/include/units/isq/iec80000/traffic_intensity.h +++ b/src/systems/isq-iec80000/include/units/isq/iec80000/traffic_intensity.h @@ -43,7 +43,7 @@ concept TrafficIntensity = QuantityOf; template U, Representation Rep = double> using traffic_intensity = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -51,9 +51,9 @@ constexpr auto operator"" _q_E(unsigned long long l) { gsl_ExpectsAudit(std::in_ } // namespace literals -#endif // UNITS_LITERALS +#endif // UNITS_NO_LITERALS -#ifdef UNITS_REFERENCES +#ifndef UNITS_NO_REFERENCES namespace traffic_intensity_references { @@ -67,11 +67,11 @@ using namespace traffic_intensity_references; } // namespace references -#endif // UNITS_REFERENCES +#endif // UNITS_NO_REFERENCES } // namespace units::isq::iec80000 -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::iec80000::inline traffic_intensity { @@ -79,4 +79,4 @@ template using E = units::isq::iec80000::traffic_in } // namespace units::aliases::isq::iec80000::inline traffic_intensity -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/isq-iec80000/include/units/isq/iec80000/transfer_rate.h b/src/systems/isq-iec80000/include/units/isq/iec80000/transfer_rate.h index 29f4248a..06c8ab63 100644 --- a/src/systems/isq-iec80000/include/units/isq/iec80000/transfer_rate.h +++ b/src/systems/isq-iec80000/include/units/isq/iec80000/transfer_rate.h @@ -52,7 +52,7 @@ concept TransferRate = QuantityOf; template U, Representation Rep = double> using transfer_rate = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -68,11 +68,11 @@ constexpr auto operator"" _q_YB_per_s(unsigned long long l) { gsl_ExpectsAudit(s } // namespace literals -#endif // UNITS_LITERALS +#endif // UNITS_NO_LITERALS } // namespace units::isq::iec80000 -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::iec80000::inline transfer_rate { @@ -88,4 +88,4 @@ template using YB_per_s = units::isq::iec80000::tra } // namespace units::aliases::isq::iec80000::inline transfer_rate -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/isq-natural/include/units/isq/natural/acceleration.h b/src/systems/isq-natural/include/units/isq/natural/acceleration.h index 735cad68..35f765eb 100644 --- a/src/systems/isq-natural/include/units/isq/natural/acceleration.h +++ b/src/systems/isq-natural/include/units/isq/natural/acceleration.h @@ -40,7 +40,7 @@ struct dim_acceleration : isq::dim_acceleration U, Representation Rep = double> using acceleration = quantity; -#ifdef UNITS_REFERENCES +#ifndef UNITS_NO_REFERENCES namespace acceleration_references { @@ -54,11 +54,11 @@ using namespace acceleration_references; } // namespace references -#endif // UNITS_REFERENCES +#endif // UNITS_NO_REFERENCES } // namespace units::isq::natural -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::natural::inline acceleration { @@ -66,4 +66,4 @@ template using GeV = units::isq::natural::accelerat } // namespace units::aliases::isq::natural::inline acceleration -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/isq-natural/include/units/isq/natural/energy.h b/src/systems/isq-natural/include/units/isq/natural/energy.h index f5f9db3d..9924af00 100644 --- a/src/systems/isq-natural/include/units/isq/natural/energy.h +++ b/src/systems/isq-natural/include/units/isq/natural/energy.h @@ -40,7 +40,7 @@ struct dim_energy : isq::dim_energy U, Representation Rep = double> using energy = quantity; -#ifdef UNITS_REFERENCES +#ifndef UNITS_NO_REFERENCES namespace energy_references { @@ -54,11 +54,11 @@ using namespace energy_references; } // namespace references -#endif // UNITS_REFERENCES +#endif // UNITS_NO_REFERENCES } // namespace units::isq::natural -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::natural::inline energy { @@ -66,4 +66,4 @@ template using GeV = units::isq::natural::energy U, Representation Rep = double> using force = quantity; -#ifdef UNITS_REFERENCES +#ifndef UNITS_NO_REFERENCES namespace force_references { @@ -54,11 +54,11 @@ using namespace force_references; } // namespace references -#endif // UNITS_REFERENCES +#endif // UNITS_NO_REFERENCES } // namespace units::isq::natural -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::natural::inline force { @@ -66,4 +66,4 @@ template using GeV2 = units::isq::natural::force {}; template U, Representation Rep = double> using length = quantity; -#ifdef UNITS_REFERENCES +#ifndef UNITS_NO_REFERENCES namespace length_references { @@ -51,11 +51,11 @@ using namespace length_references; } // namespace references -#endif // UNITS_REFERENCES +#endif // UNITS_NO_REFERENCES } // namespace units::isq::natural -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::natural::inline length { @@ -63,4 +63,4 @@ template using inv_GeV = units::isq::natural::lengt } // namespace units::aliases::isq::natural::inline length -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/isq-natural/include/units/isq/natural/mass.h b/src/systems/isq-natural/include/units/isq/natural/mass.h index 7efca445..55d8a24f 100644 --- a/src/systems/isq-natural/include/units/isq/natural/mass.h +++ b/src/systems/isq-natural/include/units/isq/natural/mass.h @@ -37,7 +37,7 @@ struct dim_mass : isq::dim_mass {}; template U, Representation Rep = double> using mass = quantity; -#ifdef UNITS_REFERENCES +#ifndef UNITS_NO_REFERENCES namespace mass_references { @@ -51,11 +51,11 @@ using namespace mass_references; } // namespace references -#endif // UNITS_REFERENCES +#endif // UNITS_NO_REFERENCES } // namespace units::isq::natural -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::natural::inline mass { @@ -63,4 +63,4 @@ template using GeV = units::isq::natural::mass U, Representation Rep = double> using momentum = quantity; -#ifdef UNITS_REFERENCES +#ifndef UNITS_NO_REFERENCES namespace momentum_references { @@ -54,11 +54,11 @@ using namespace momentum_references; } // namespace references -#endif // UNITS_REFERENCES +#endif // UNITS_NO_REFERENCES } // namespace units::isq::natural -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::natural::inline momentum { @@ -66,4 +66,4 @@ template using GeV = units::isq::natural::momentum< } // namespace units::aliases::isq::natural::inline momentum -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/isq-natural/include/units/isq/natural/time.h b/src/systems/isq-natural/include/units/isq/natural/time.h index 8c98870d..ea903166 100644 --- a/src/systems/isq-natural/include/units/isq/natural/time.h +++ b/src/systems/isq-natural/include/units/isq/natural/time.h @@ -37,7 +37,7 @@ struct dim_time : isq::dim_time {}; template U, Representation Rep = double> using time = quantity; -#ifdef UNITS_REFERENCES +#ifndef UNITS_NO_REFERENCES namespace time_references { @@ -51,11 +51,11 @@ using namespace time_references; } // namespace references -#endif // UNITS_REFERENCES +#endif // UNITS_NO_REFERENCES } // namespace units::isq::natural -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::natural::inline time { @@ -63,4 +63,4 @@ template using inv_GeV = units::isq::natural::time< } // namespace units::aliases::isq::natural::inline time -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si-cgs/include/units/isq/si/cgs/acceleration.h b/src/systems/si-cgs/include/units/isq/si/cgs/acceleration.h index fd349032..26c5aea2 100644 --- a/src/systems/si-cgs/include/units/isq/si/cgs/acceleration.h +++ b/src/systems/si-cgs/include/units/isq/si/cgs/acceleration.h @@ -40,7 +40,7 @@ struct dim_acceleration : isq::dim_acceleration U, Representation Rep = double> using acceleration = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -50,9 +50,9 @@ constexpr auto operator"" _q_Gal(long double l) { return acceleration using Gal = units::isq::si::cgs::accelerat } // namespace units::aliases::isq::si::cgs::inline acceleration -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si-cgs/include/units/isq/si/cgs/area.h b/src/systems/si-cgs/include/units/isq/si/cgs/area.h index 5f0f1495..ceb567ae 100644 --- a/src/systems/si-cgs/include/units/isq/si/cgs/area.h +++ b/src/systems/si-cgs/include/units/isq/si/cgs/area.h @@ -42,7 +42,7 @@ struct dim_area : isq::dim_area {}; template U, Representation Rep = double> using area = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -52,9 +52,9 @@ constexpr auto operator"" _q_cm2(long double l) { return area using cm2 = units::isq::si::cgs::area {}; template U, Representation Rep = double> using energy = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -52,9 +52,9 @@ constexpr auto operator"" _q_erg(long double l) { return energy using erg = units::isq::si::cgs::energy { template U, Representation Rep = double> using force = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -53,9 +53,9 @@ constexpr auto operator"" _q_dyn(long double l) { return force using dyn = units::isq::si::cgs::force {}; template U, Representation Rep = double> using length = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -51,9 +51,9 @@ constexpr auto operator"" _q_cm(long double l) { return length using cm = units::isq::si::cgs::length {}; template U, Representation Rep = double> using mass = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -51,9 +51,9 @@ constexpr auto operator"" _q_g(long double l) { return mass(l } // namespace literals -#endif // UNITS_LITERALS +#endif // UNITS_NO_LITERALS -#ifdef UNITS_REFERENCES +#ifndef UNITS_NO_REFERENCES namespace mass_references { @@ -67,11 +67,11 @@ using namespace mass_references; } // namespace references -#endif // UNITS_REFERENCES +#endif // UNITS_NO_REFERENCES } // namespace units::isq::si::cgs -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::si::cgs::inline mass { @@ -79,4 +79,4 @@ template using g = units::isq::si::cgs::mass U, Representation Rep = double> using power = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -51,11 +51,11 @@ constexpr auto operator"" _q_erg_per_s(long double l) { return power using erg_per_s = units::isq::si::cgs::pow } // namespace units::aliases::isq::si::cgs::inline power -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si-cgs/include/units/isq/si/cgs/pressure.h b/src/systems/si-cgs/include/units/isq/si/cgs/pressure.h index d10ec70c..cae347e9 100644 --- a/src/systems/si-cgs/include/units/isq/si/cgs/pressure.h +++ b/src/systems/si-cgs/include/units/isq/si/cgs/pressure.h @@ -43,7 +43,7 @@ struct dim_pressure : isq::dim_pressure U, Representation Rep = double> using pressure = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -53,9 +53,9 @@ constexpr auto operator"" _q_Ba(long double l) { return pressure using Ba = units::isq::si::cgs::pressure U, Representation Rep = double> using speed = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -50,11 +50,11 @@ constexpr auto operator"" _q_cm_per_s(long double l) { return speed using cm_per_s = units::isq::si::cgs::spee } // namespace units::aliases::isq::si::cgs::inline speed -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si-cgs/include/units/isq/si/cgs/time.h b/src/systems/si-cgs/include/units/isq/si/cgs/time.h index b3b0c1c4..f721c5b7 100644 --- a/src/systems/si-cgs/include/units/isq/si/cgs/time.h +++ b/src/systems/si-cgs/include/units/isq/si/cgs/time.h @@ -37,7 +37,7 @@ using si::second; using si::dim_time; using si::time; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -45,9 +45,9 @@ using si::literals::operator"" _q_s; } // namespace literals -#endif // UNITS_LITERALS +#endif // UNITS_NO_LITERALS -#ifdef UNITS_REFERENCES +#ifndef UNITS_NO_REFERENCES namespace time_references { @@ -61,11 +61,11 @@ using namespace time_references; } // namespace references -#endif // UNITS_REFERENCES +#endif // UNITS_NO_REFERENCES } // namespace units::isq::si::cgs -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::si::cgs::inline time { @@ -73,4 +73,4 @@ using namespace units::aliases::isq::si::time; } // namespace units::aliases::isq::si::cgs::inline time -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si-fps/include/units/isq/si/fps/acceleration.h b/src/systems/si-fps/include/units/isq/si/fps/acceleration.h index e6587f58..507495e7 100644 --- a/src/systems/si-fps/include/units/isq/si/fps/acceleration.h +++ b/src/systems/si-fps/include/units/isq/si/fps/acceleration.h @@ -39,7 +39,7 @@ struct dim_acceleration : isq::dim_acceleration U, Representation Rep = double> using acceleration = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -49,11 +49,11 @@ constexpr auto operator"" _q_ft_per_s2(long double l) { return acceleration using ft_per_s2 = units::isq::si::fps::acc } // namespace units::aliases::isq::si::fps::inline acceleration -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si-fps/include/units/isq/si/fps/area.h b/src/systems/si-fps/include/units/isq/si/fps/area.h index 2f967eb2..d02e5732 100644 --- a/src/systems/si-fps/include/units/isq/si/fps/area.h +++ b/src/systems/si-fps/include/units/isq/si/fps/area.h @@ -41,7 +41,7 @@ struct dim_area : isq::dim_area {}; template U, Representation Rep = double> using area = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -51,9 +51,9 @@ constexpr auto operator"" _q_ft2(long double l) { return area using ft2 = units::isq::si::fps::area U, Representation Rep = double> using density = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -51,11 +51,11 @@ constexpr auto operator"" _q_lb_per_ft3(long double l) { return density using lb_per_ft3 = units::isq::si::fps::de } // namespace units::aliases::isq::si::fps::inline density -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si-fps/include/units/isq/si/fps/energy.h b/src/systems/si-fps/include/units/isq/si/fps/energy.h index 1f559b75..250f0e88 100644 --- a/src/systems/si-fps/include/units/isq/si/fps/energy.h +++ b/src/systems/si-fps/include/units/isq/si/fps/energy.h @@ -45,7 +45,7 @@ struct foot_pound_force : noble_deduced_unit U, Representation Rep = double> using energy = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -59,11 +59,11 @@ constexpr auto operator"" _q_ft_lbf(long double l) { return energy using ft_lbf = units::isq::si::fps::energy } // namespace units::aliases::isq::si::fps::inline energy -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si-fps/include/units/isq/si/fps/force.h b/src/systems/si-fps/include/units/isq/si/fps/force.h index 43efd300..43e91a01 100644 --- a/src/systems/si-fps/include/units/isq/si/fps/force.h +++ b/src/systems/si-fps/include/units/isq/si/fps/force.h @@ -52,7 +52,7 @@ struct dim_force : isq::dim_force U, Representation Rep = double> using force = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -70,9 +70,9 @@ constexpr auto operator"" _q_klbf(long double l) { return force using klbf = units::isq::si::fps::force {}; template U, Representation Rep = double> using length = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -100,9 +100,9 @@ constexpr auto operator"" _q_naut_mi(long double l) { return length using naut_mi = units::isq::si::fps::lengt } // namespace units::aliases::isq::si::fps::inline length -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si-fps/include/units/isq/si/fps/mass.h b/src/systems/si-fps/include/units/isq/si/fps/mass.h index 8471c127..cbf50513 100644 --- a/src/systems/si-fps/include/units/isq/si/fps/mass.h +++ b/src/systems/si-fps/include/units/isq/si/fps/mass.h @@ -58,7 +58,7 @@ struct short_ton : named_scaled_unit{}; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -100,9 +100,9 @@ constexpr auto operator"" _q_lton(long double l) { return mass using lton = units::isq::si::fps::mass U, Representation Rep = double> using power = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -64,9 +64,9 @@ constexpr auto operator"" _q_hp(long double l) { return power using hp = units::isq::si::fps::power {}; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -67,9 +67,9 @@ constexpr auto operator"" _q_kpsi(long double l) { return pressure using kpsi = units::isq::si::fps::pressure } // namespace units::aliases::isq::si::fps::inline pressure -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si-fps/include/units/isq/si/fps/speed.h b/src/systems/si-fps/include/units/isq/si/fps/speed.h index 16ac98e5..2a2616a8 100644 --- a/src/systems/si-fps/include/units/isq/si/fps/speed.h +++ b/src/systems/si-fps/include/units/isq/si/fps/speed.h @@ -47,7 +47,7 @@ struct nautical_mile_per_hour : named_deduced_unit {}; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -65,9 +65,9 @@ constexpr auto operator"" _q_knot(long double l) { return speed using knot = units::isq::si::fps::speed {}; template U, Representation Rep = double> using volume = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -56,9 +56,9 @@ constexpr auto operator"" _q_yd3(long double l) { return volume using yd3 = units::isq::si::fps::volume {}; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -62,9 +62,9 @@ constexpr auto operator"" _q_angstrom(long double l) { return si::length using angstrom = units::isq::si::length {}; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -54,9 +54,9 @@ constexpr auto operator"" _q_rd(long double l) { return si::length using rd = units::isq::si::length {}; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -47,9 +47,9 @@ constexpr auto operator"" _q_ft2(long double l) { return si::area using ft2 = units::isq::si::area { // https://en.wikipedia.org/wiki/Thousandth_of_an_inch using mil = thou; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -104,9 +104,9 @@ constexpr auto operator"" _q_mil(long double l) { return si::length using mil = units::isq::si::length {}; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -46,11 +46,11 @@ constexpr auto operator"" _q_mi_per_h(long double l) { return si::speed using mi_per_h = units::isq::si::speed {}; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -47,9 +47,9 @@ constexpr auto operator"" _q_ft3(long double l) { return si::volume using ft3 = units::isq::si::volume {}; struct point_prn : named_scaled_unit {}; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -63,9 +63,9 @@ constexpr auto operator"" _q_point_prn(long double l) { return si::length using point_prn = units::isq::si::length {}; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -63,9 +63,9 @@ constexpr auto operator"" _q_mi_us(long double l) { return si::length using mi = units::isq::si::length U, Representation Rep = double> using absorbed_dose = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -152,9 +152,9 @@ constexpr auto operator"" _q_YGy(long double l) { return absorbed_dose using YGy = units::isq::si::absorbed_dose< } // namespace units::aliases::isq::si::inline absorbed_dose -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/acceleration.h b/src/systems/si/include/units/isq/si/acceleration.h index 8cfa0331..c6e8110e 100644 --- a/src/systems/si/include/units/isq/si/acceleration.h +++ b/src/systems/si/include/units/isq/si/acceleration.h @@ -39,7 +39,7 @@ struct dim_acceleration : isq::dim_acceleration U, Representation Rep = double> using acceleration = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -49,11 +49,11 @@ constexpr auto operator"" _q_m_per_s2(long double l) { return acceleration using m_per_s2 = units::isq::si::accelerat } // namespace units::aliases::isq::si::inline acceleration -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/amount_of_substance.h b/src/systems/si/include/units/isq/si/amount_of_substance.h index b1e074a1..79282af9 100644 --- a/src/systems/si/include/units/isq/si/amount_of_substance.h +++ b/src/systems/si/include/units/isq/si/amount_of_substance.h @@ -41,7 +41,7 @@ struct dim_amount_of_substance : isq::dim_amount_of_substance {}; template U, Representation Rep = double> using amount_of_substance = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -51,9 +51,9 @@ constexpr auto operator"" _q_mol(long double l) { return amount_of_substance using mol = units::isq::si::amount_of_subs } // namespace units::aliases::isq::si::inline amount_of_substance -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/angular_velocity.h b/src/systems/si/include/units/isq/si/angular_velocity.h index 316708b9..52fd092b 100644 --- a/src/systems/si/include/units/isq/si/angular_velocity.h +++ b/src/systems/si/include/units/isq/si/angular_velocity.h @@ -41,7 +41,7 @@ struct dim_angular_velocity : isq::dim_angular_velocity U, Representation Rep = double> using angular_velocity = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -51,11 +51,11 @@ constexpr auto operator"" _q_rad_per_s(long double l) { return angular_velocity< } // namespace literals -#endif // UNITS_LITERALS +#endif // UNITS_NO_LITERALS } // namespace units::isq::si -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::si::inline angular_velocity { @@ -63,4 +63,4 @@ template using rad_per_s = units::isq::si::angular_ } // namespace units::aliases::isq::si::inline angular_velocity -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/area.h b/src/systems/si/include/units/isq/si/area.h index 3ffb5744..d6571961 100644 --- a/src/systems/si/include/units/isq/si/area.h +++ b/src/systems/si/include/units/isq/si/area.h @@ -63,7 +63,7 @@ struct hectare : alias_unit {}; template U, Representation Rep = double> using area = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -157,9 +157,9 @@ constexpr auto operator"" _q_ha(long double l) { return area using ha = units::isq::si::area U, Representation Rep = double> using capacitance = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -153,9 +153,9 @@ constexpr auto operator"" _q_YF(long double l) { return capacitance using YF = units::isq::si::capacitance U, Representation Rep = double> using catalytic_activity = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -159,9 +159,9 @@ constexpr auto operator"" _q_U(long double l) { return catalytic_activity using U = units::isq::si::catalytic_activi } // namespace units::aliases::isq::si::inline catalytic_activity -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/charge_density.h b/src/systems/si/include/units/isq/si/charge_density.h index 441cb5fc..ec23d422 100644 --- a/src/systems/si/include/units/isq/si/charge_density.h +++ b/src/systems/si/include/units/isq/si/charge_density.h @@ -47,7 +47,7 @@ using charge_density = quantity; template U, Representation Rep = double> using surface_charge_density = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -61,11 +61,11 @@ constexpr auto operator"" _q_C_per_m2(long double l) { return surface_charge_den } // namespace literals -#endif // UNITS_LITERALS +#endif // UNITS_NO_LITERALS } // namespace units::isq::si -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::si::inline charge_density { @@ -74,4 +74,4 @@ template using C_per_m2 = units::isq::si::surface_c } // namespace units::aliases::isq::si::inline charge_density -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/concentration.h b/src/systems/si/include/units/isq/si/concentration.h index 99a99ae8..903f943a 100644 --- a/src/systems/si/include/units/isq/si/concentration.h +++ b/src/systems/si/include/units/isq/si/concentration.h @@ -40,7 +40,7 @@ struct dim_concentration : isq::dim_concentration U, Representation Rep = double> using concentration = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -50,11 +50,11 @@ constexpr auto operator"" _q_mol_per_m3(long double l) { return concentration using mol_per_m3 = units::isq::si::concent } // namespace units::aliases::isq::si::inline concentration -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/conductance.h b/src/systems/si/include/units/isq/si/conductance.h index 11877476..50fd7dee 100644 --- a/src/systems/si/include/units/isq/si/conductance.h +++ b/src/systems/si/include/units/isq/si/conductance.h @@ -58,7 +58,7 @@ struct dim_conductance : isq::dim_conductance U, Representation Rep = double> using conductance = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -132,9 +132,9 @@ constexpr auto operator"" _q_YS(long double l) { return conductance using YS = units::isq::si::conductance U, Representation Rep = double> using current_density = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -52,11 +52,11 @@ constexpr auto operator"" _q_A_per_m2(long double l) { return current_density using A_per_m2 = units::isq::si::current_d } // namespace units::aliases::isq::si::inline current_density -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/density.h b/src/systems/si/include/units/isq/si/density.h index 192c16b6..5b0cf016 100644 --- a/src/systems/si/include/units/isq/si/density.h +++ b/src/systems/si/include/units/isq/si/density.h @@ -42,7 +42,7 @@ struct dim_density : isq::dim_density U, Representation Rep = double> using density = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -52,11 +52,11 @@ constexpr auto operator"" _q_kg_per_m3(long double l) { return density using kg_per_m3 = units::isq::si::density< } // namespace units::aliases::isq::si::inline density -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/dynamic_viscosity.h b/src/systems/si/include/units/isq/si/dynamic_viscosity.h index 5ee4571f..4b9b4339 100644 --- a/src/systems/si/include/units/isq/si/dynamic_viscosity.h +++ b/src/systems/si/include/units/isq/si/dynamic_viscosity.h @@ -40,7 +40,7 @@ struct dim_dynamic_viscosity : isq::dim_dynamic_viscosity U, Representation Rep = double> using dynamic_viscosity = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -50,11 +50,11 @@ constexpr auto operator"" _q_Pa_s(long double l) { return dynamic_viscosity using Pa_s = units::isq::si::dynamic_visco } // namespace units::aliases::isq::si::inline dynamic_viscosity -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/electric_charge.h b/src/systems/si/include/units/isq/si/electric_charge.h index 7dd60373..6b522952 100644 --- a/src/systems/si/include/units/isq/si/electric_charge.h +++ b/src/systems/si/include/units/isq/si/electric_charge.h @@ -42,7 +42,7 @@ struct dim_electric_charge : isq::dim_electric_charge U, Representation Rep = double> using electric_charge = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -52,9 +52,9 @@ constexpr auto operator"" _q_C(long double l) { return electric_charge using C = units::isq::si::electric_charge< } // namespace units::aliases::isq::si::inline electric_charge -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/electric_current.h b/src/systems/si/include/units/isq/si/electric_current.h index f295862a..f71b86bf 100644 --- a/src/systems/si/include/units/isq/si/electric_current.h +++ b/src/systems/si/include/units/isq/si/electric_current.h @@ -61,7 +61,7 @@ struct dim_electric_current : isq::dim_electric_current {}; template U, Representation Rep = double> using electric_current = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -151,9 +151,9 @@ constexpr auto operator"" _q_YA(long double l) { return electric_current using YA = units::isq::si::electric_curren } // namespace units::aliases::isq::si::inline electric_current -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/electric_field_strength.h b/src/systems/si/include/units/isq/si/electric_field_strength.h index ec11149c..290b4dbb 100644 --- a/src/systems/si/include/units/isq/si/electric_field_strength.h +++ b/src/systems/si/include/units/isq/si/electric_field_strength.h @@ -39,7 +39,7 @@ struct dim_electric_field_strength : isq::dim_electric_field_strength U, Representation Rep = double> using electric_field_strength = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -49,11 +49,11 @@ constexpr auto operator"" _q_V_per_m(long double l) { return electric_field_stre } // namespace literals -#endif // UNITS_LITERALS +#endif // UNITS_NO_LITERALS } // namespace units::isq::si -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::si::inline electric_field_strength { @@ -61,4 +61,4 @@ template using V_per_m = units::isq::si::electric_f } // namespace units::aliases::isq::si::inline electric_field_strength -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/energy.h b/src/systems/si/include/units/isq/si/energy.h index f4a36b16..ddcbb270 100644 --- a/src/systems/si/include/units/isq/si/energy.h +++ b/src/systems/si/include/units/isq/si/energy.h @@ -61,7 +61,7 @@ struct dim_energy : isq::dim_energy {} template U, Representation Rep = double> using energy = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -143,9 +143,9 @@ constexpr auto operator"" _q_GeV(long double l) { return energy using GeV = units::isq::si::energy U, Representation Rep = double> using energy_density = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -50,11 +50,11 @@ constexpr auto operator"" _q_J_per_m3(long double l) { return energy_density using J_per_m3 = units::isq::si::energy_de } // namespace units::aliases::isq::si::inline energy_density -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/force.h b/src/systems/si/include/units/isq/si/force.h index 09bb70ae..484e7aeb 100644 --- a/src/systems/si/include/units/isq/si/force.h +++ b/src/systems/si/include/units/isq/si/force.h @@ -63,7 +63,7 @@ struct dim_force : isq::dim_force template U, Representation Rep = double> using force = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -153,9 +153,9 @@ constexpr auto operator"" _q_YN(long double l) { return force using YN = units::isq::si::force {}; template U, Representation Rep = double> using frequency = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -131,9 +131,9 @@ constexpr auto operator"" _q_YHz(long double l) { return frequency using YHz = units::isq::si::frequency; template U, Representation Rep = double> using molar_heat_capacity = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -71,11 +71,11 @@ constexpr auto operator"" _q_J_per_mol_K(long double l) { return molar_heat_capa } // namespace literals -#endif // UNITS_LITERALS +#endif // UNITS_NO_LITERALS } // namespace units::isq::si -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::si::heat_capacity { @@ -85,4 +85,4 @@ template using J_per_mol_K = units::isq::si::molar_ } // namespace units::aliases::isq::si::heat_capacity -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/inductance.h b/src/systems/si/include/units/isq/si/inductance.h index 82fcb963..3ca6a0d9 100644 --- a/src/systems/si/include/units/isq/si/inductance.h +++ b/src/systems/si/include/units/isq/si/inductance.h @@ -59,7 +59,7 @@ struct dim_inductance : isq::dim_inductance U, Representation Rep = double> using inductance = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -133,9 +133,9 @@ constexpr auto operator"" _q_YH(long double l) { return inductance using YH = units::isq::si::inductance {}; template U, Representation Rep = double> using length = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -157,9 +157,9 @@ constexpr auto operator"" _q_au(long double l) { return length using au = units::isq::si::length U, Representation Rep = double> using luminance = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -50,11 +50,11 @@ constexpr auto operator"" _q_cd_per_m2(long double l) { return luminance using cd_per_m2 = units::isq::si::luminanc } // namespace units::aliases::isq::si::inline luminance -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/luminous_intensity.h b/src/systems/si/include/units/isq/si/luminous_intensity.h index 85299c40..7d0a78ec 100644 --- a/src/systems/si/include/units/isq/si/luminous_intensity.h +++ b/src/systems/si/include/units/isq/si/luminous_intensity.h @@ -61,7 +61,7 @@ struct dim_luminous_intensity : isq::dim_luminous_intensity {}; template U, Representation Rep = double> using luminous_intensity = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -151,9 +151,9 @@ constexpr auto operator"" _q_Ycd(long double l) { return luminous_intensity using Ycd = units::isq::si::luminous_inten } // namespace units::aliases::isq::si::luminous_intensity -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/magnetic_flux.h b/src/systems/si/include/units/isq/si/magnetic_flux.h index e106f6fd..78f22854 100644 --- a/src/systems/si/include/units/isq/si/magnetic_flux.h +++ b/src/systems/si/include/units/isq/si/magnetic_flux.h @@ -59,7 +59,7 @@ struct dim_magnetic_flux : isq::dim_magnetic_flux U, Representation Rep = double> using magnetic_flux = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -133,9 +133,9 @@ constexpr auto operator"" _q_YWb(long double l) { return magnetic_flux using YWb = units::isq::si::magnetic_flux< } // namespace units::aliases::isq::si::inline magnetic_flux -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/magnetic_induction.h b/src/systems/si/include/units/isq/si/magnetic_induction.h index cfccd5da..71a3a3e7 100644 --- a/src/systems/si/include/units/isq/si/magnetic_induction.h +++ b/src/systems/si/include/units/isq/si/magnetic_induction.h @@ -63,7 +63,7 @@ struct dim_magnetic_induction : isq::dim_magnetic_induction U, Representation Rep = double> using magnetic_induction = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -141,9 +141,9 @@ constexpr auto operator"" _q_G(long double l) { return magnetic_induction using G = units::isq::si::magnetic_inducti } // namespace units::aliases::isq::si::inline magnetic_induction -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/mass.h b/src/systems/si/include/units/isq/si/mass.h index 38fc58f8..a13c4047 100644 --- a/src/systems/si/include/units/isq/si/mass.h +++ b/src/systems/si/include/units/isq/si/mass.h @@ -85,7 +85,7 @@ struct dim_mass : isq::dim_mass {}; template U, Representation Rep = double> using mass = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -264,9 +264,9 @@ constexpr auto operator"" _q_Da(long double l) { return mass using Da = units::isq::si::mass U, Representation Rep = double> using molar_energy = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -52,11 +52,11 @@ constexpr auto operator"" _q_J_per_mol(long double l) { return molar_energy using J_per_mol = units::isq::si::molar_en } // namespace units::aliases::isq::si::inline molar_energy -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/momentum.h b/src/systems/si/include/units/isq/si/momentum.h index 0123837f..28151b6f 100644 --- a/src/systems/si/include/units/isq/si/momentum.h +++ b/src/systems/si/include/units/isq/si/momentum.h @@ -40,7 +40,7 @@ struct dim_momentum : isq::dim_momentum U, Representation Rep = double> using momentum = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -50,11 +50,11 @@ constexpr auto operator"" _q_kg_m_per_s(long double l) { return momentum using kg_m_per_s = units::isq::si::momentu } // namespace units::aliases::isq::si::inline momentum -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/permeability.h b/src/systems/si/include/units/isq/si/permeability.h index 3b16a50b..260e5658 100644 --- a/src/systems/si/include/units/isq/si/permeability.h +++ b/src/systems/si/include/units/isq/si/permeability.h @@ -41,7 +41,7 @@ struct dim_permeability : isq::dim_permeability U, Representation Rep = double> using permeability = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -51,11 +51,11 @@ constexpr auto operator"" _q_H_per_m(long double l) { return permeability using H_per_m = units::isq::si::permeabili } // namespace units::aliases::isq::si::inline permeability -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/permittivity.h b/src/systems/si/include/units/isq/si/permittivity.h index d367b518..850430fe 100644 --- a/src/systems/si/include/units/isq/si/permittivity.h +++ b/src/systems/si/include/units/isq/si/permittivity.h @@ -41,7 +41,7 @@ struct dim_permittivity : isq::dim_permittivity U, Representation Rep = double> using permittivity = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -51,11 +51,11 @@ constexpr auto operator"" _q_F_per_m(long double l) { return permittivity using F_per_m = units::isq::si::permittivi } // namespace units::aliases::isq::si::inline permittivity -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/power.h b/src/systems/si/include/units/isq/si/power.h index 371385fb..ebe1bb03 100644 --- a/src/systems/si/include/units/isq/si/power.h +++ b/src/systems/si/include/units/isq/si/power.h @@ -58,7 +58,7 @@ struct dim_power : isq::dim_power {}; template U, Representation Rep = double> using power = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -132,9 +132,9 @@ constexpr auto operator"" _q_YW(long double l) { return power using YW = units::isq::si::power U, Representation Rep = double> using pressure = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -153,9 +153,9 @@ constexpr auto operator"" _q_YPa(long double l) { return pressure using YPa = units::isq::si::pressure U, Representation Rep = double> using radioactivity = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -151,9 +151,9 @@ constexpr auto operator"" _q_YBq(long double l) { return radioactivity using YBq = units::isq::radioactivity U, Representation Rep = double> using resistance = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -133,9 +133,9 @@ constexpr auto operator"" _q_YR(long double l) { return resistance using YR = units::isq::si::resistance U, Representation Rep = double> using speed = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -56,11 +56,11 @@ constexpr auto operator"" _q_km_per_h(long double l) { return speed using km_per_h = units::isq::si::speed U, Representation Rep = double> using surface_tension = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -50,11 +50,11 @@ constexpr auto operator"" _q_N_per_m(long double l) { return surface_tension using N_per_m = units::isq::si::surface_te } // namespace units::aliases::isq::si::inline surface_tension -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/thermal_conductivity.h b/src/systems/si/include/units/isq/si/thermal_conductivity.h index b85eff41..eab781db 100644 --- a/src/systems/si/include/units/isq/si/thermal_conductivity.h +++ b/src/systems/si/include/units/isq/si/thermal_conductivity.h @@ -41,7 +41,7 @@ struct dim_thermal_conductivity : isq::dim_thermal_conductivity U, Representation Rep = double> using thermal_conductivity = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -51,11 +51,11 @@ constexpr auto operator"" _q_W_per_m_K(long double l) { return thermal_conductiv } // namespace literals -#endif // UNITS_LITERALS +#endif // UNITS_NO_LITERALS } // namespace units::isq::si -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::si::inline thermal_conductivity { @@ -63,4 +63,4 @@ template using W_per_m_K = units::isq::si::thermal_ } // namespace units::aliases::isq::si::inline thermal_conductivity -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/thermodynamic_temperature.h b/src/systems/si/include/units/isq/si/thermodynamic_temperature.h index e1cbf0f8..10ee923b 100644 --- a/src/systems/si/include/units/isq/si/thermodynamic_temperature.h +++ b/src/systems/si/include/units/isq/si/thermodynamic_temperature.h @@ -40,7 +40,7 @@ struct dim_thermodynamic_temperature : isq::dim_thermodynamic_temperature U, Representation Rep = double> using thermodynamic_temperature = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -50,9 +50,9 @@ constexpr auto operator"" _q_K(long double l) { return thermodynamic_temperature } // namespace literals -#endif // UNITS_LITERALS +#endif // UNITS_NO_LITERALS -#ifdef UNITS_REFERENCES +#ifndef UNITS_NO_REFERENCES namespace thermodynamic_temperature_references { @@ -66,11 +66,11 @@ using namespace thermodynamic_temperature_references; } // namespace references -#endif // UNITS_REFERENCES +#endif // UNITS_NO_REFERENCES } // namespace units::isq::si -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::si::inline thermodynamic_temperature { @@ -78,4 +78,4 @@ template using K = units::isq::si::thermodynamic_te } // namespace units::aliases::isq::si::inline thermodynamic_temperature -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/time.h b/src/systems/si/include/units/isq/si/time.h index d9201b67..ebcd163e 100644 --- a/src/systems/si/include/units/isq/si/time.h +++ b/src/systems/si/include/units/isq/si/time.h @@ -52,7 +52,7 @@ struct dim_time : isq::dim_time {}; template U, Representation Rep = double> using time = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -106,9 +106,9 @@ constexpr auto operator"" _q_d(long double l) { return time(l) } // namespace literals -#endif // UNITS_LITERALS +#endif // UNITS_NO_LITERALS -#ifdef UNITS_REFERENCES +#ifndef UNITS_NO_REFERENCES namespace time_references { @@ -133,11 +133,11 @@ using namespace time_references; } // namespace references -#endif // UNITS_REFERENCES +#endif // UNITS_NO_REFERENCES } // namespace units::isq::si -#ifdef UNITS_ALIASES +#ifndef UNITS_NO_ALIASES namespace units::aliases::isq::si::inline time { @@ -156,4 +156,4 @@ template using d = units::isq::si::time U, Representation Rep = double> using torque = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -52,11 +52,11 @@ constexpr auto operator"" _q_N_m_per_rad(long double l) { return torque using N_m_per_rad = units::isq::si::torque } // namespace units::aliases::isq::si::inline torque -#endif // UNITS_ALIASES +#endif // UNITS_NO_ALIASES diff --git a/src/systems/si/include/units/isq/si/voltage.h b/src/systems/si/include/units/isq/si/voltage.h index ce50f61e..8f10478f 100644 --- a/src/systems/si/include/units/isq/si/voltage.h +++ b/src/systems/si/include/units/isq/si/voltage.h @@ -63,7 +63,7 @@ struct dim_voltage : isq::dim_voltage U, Representation Rep = double> using voltage = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -153,9 +153,9 @@ constexpr auto operator"" _q_YV(long double l) { return voltage using YV = units::isq::si::voltage {}; template U, Representation Rep = double> using volume = quantity; -#ifdef UNITS_LITERALS +#ifndef UNITS_NO_LITERALS inline namespace literals { @@ -257,9 +257,9 @@ constexpr auto operator"" _q_Yl(long double l) { return volume using Yl = units::isq::si::volume,/wd4242 /wd4244,-Wno-conversion> ) -target_compile_definitions(unit_tests_static_truncating PRIVATE - UNITS_REFERENCES - UNITS_LITERALS - UNITS_ALIASES -) add_library(unit_tests_static cgs_test.cpp @@ -78,8 +73,3 @@ target_link_libraries(unit_tests_static PRIVATE unit_tests_static_truncating mp-units::mp-units ) -target_compile_definitions(unit_tests_static PRIVATE - UNITS_REFERENCES - UNITS_LITERALS - UNITS_ALIASES -) diff --git a/test_package/CMakeLists.txt b/test_package/CMakeLists.txt index f04c2b0b..8a5eec85 100644 --- a/test_package/CMakeLists.txt +++ b/test_package/CMakeLists.txt @@ -29,4 +29,3 @@ find_package(mp-units CONFIG REQUIRED) add_executable(test_package test_package.cpp) target_link_libraries(test_package PRIVATE mp-units::mp-units) -target_compile_definitions(test_package PRIVATE UNITS_REFERENCES)