diff --git a/docs/blog/posts/2.1.0-released.md b/docs/blog/posts/2.1.0-released.md index 3138e833..e8a675f0 100644 --- a/docs/blog/posts/2.1.0-released.md +++ b/docs/blog/posts/2.1.0-released.md @@ -49,19 +49,19 @@ As a side effect, we introduced a :boom: **breaking change** :boom:. We can't us hertz anymore: ```cpp -inline constexpr struct hertz : named_unit<"Hz", 1 / second, kind_of> {} hertz; +constexpr struct hertz : named_unit<"Hz", 1 / second, kind_of> {} hertz; ``` and have to type either: ```cpp -inline constexpr struct hertz : named_unit<"Hz", one / second, kind_of> {} hertz; +constexpr struct hertz : named_unit<"Hz", one / second, kind_of> {} hertz; ``` or ```cpp -inline constexpr struct hertz : named_unit<"Hz", inverse(second), kind_of> {} hertz; +constexpr struct hertz : named_unit<"Hz", inverse(second), kind_of> {} hertz; ``` To be consistent, we applied the same change to the dimensions and quantity @@ -70,13 +70,13 @@ specifications definitions. Now, to define a _frequency_ we have to type: === "C++23" ```cpp - inline constexpr struct frequency : quantity_spec {} frequency; + constexpr struct frequency : quantity_spec {} frequency; ``` === "C++20" ```cpp - inline constexpr struct frequency : quantity_spec {} frequency; + constexpr struct frequency : quantity_spec {} frequency; ``` === "Portable" @@ -145,11 +145,11 @@ If we derive from the same instantiation of `absolute_point_origin` we end up wi point origin. This change allows us to provide different names for the same temperature points: ```cpp -inline constexpr struct absolute_zero : absolute_point_origin {} absolute_zero; -inline constexpr struct zeroth_kelvin : decltype(absolute_zero) {} zeroth_kelvin; +constexpr struct absolute_zero : absolute_point_origin {} absolute_zero; +constexpr struct zeroth_kelvin : decltype(absolute_zero) {} zeroth_kelvin; -inline constexpr struct ice_point : relative_point_origin {} ice_point; -inline constexpr struct zeroth_degree_Celsius : decltype(ice_point) {} zeroth_degree_Celsius; +constexpr struct ice_point : relative_point_origin {} ice_point; +constexpr struct zeroth_degree_Celsius : decltype(ice_point) {} zeroth_degree_Celsius; ``` Please note that this is a :boom: **breaking change** :boom: as well. diff --git a/docs/blog/posts/2.2.0-released.md b/docs/blog/posts/2.2.0-released.md index 451a1f53..55b8edd4 100644 --- a/docs/blog/posts/2.2.0-released.md +++ b/docs/blog/posts/2.2.0-released.md @@ -281,13 +281,13 @@ is why it was renamed to `symbol_text` (:boom: **breaking change** :boom:). === "Now" ```cpp - inline constexpr struct ohm final : named_unit {} ohm; + constexpr struct ohm final : named_unit {} ohm; ``` === "Before" ```cpp - inline constexpr struct ohm : named_unit {} ohm; + constexpr struct ohm : named_unit {} ohm; ``` !!! note @@ -295,7 +295,7 @@ is why it was renamed to `symbol_text` (:boom: **breaking change** :boom:). On C++20-compliant compilers it should be enough to type the following in the unit's definition: ```cpp - inline constexpr struct ohm final : named_unit<{u8"Ω", "ohm"}, volt / ampere> {} ohm; + constexpr struct ohm final : named_unit<{u8"Ω", "ohm"}, volt / ampere> {} ohm; ``` @@ -307,31 +307,31 @@ marked `final` (:boom: **breaking change** :boom:). === "Now" ```cpp - inline constexpr struct dim_length final : base_dimension<"L"> {} dim_length; - inline constexpr struct length final : quantity_spec {} length; + constexpr struct dim_length final : base_dimension<"L"> {} dim_length; + constexpr struct length final : quantity_spec {} length; - inline constexpr struct absolute_zero final : absolute_point_origin {} absolute_zero; - inline constexpr auto zeroth_kelvin = absolute_zero; - inline constexpr struct kelvin final : named_unit<"K", kind_of, zeroth_kelvin> {} kelvin; + constexpr struct absolute_zero final : absolute_point_origin {} absolute_zero; + constexpr auto zeroth_kelvin = absolute_zero; + constexpr struct kelvin final : named_unit<"K", kind_of, zeroth_kelvin> {} kelvin; - inline constexpr struct ice_point final : relative_point_origin}> {} ice_point; - inline constexpr auto zeroth_degree_Celsius = ice_point; - inline constexpr struct degree_Celsius final : named_unit {} degree_Celsius; + constexpr struct ice_point final : relative_point_origin}> {} ice_point; + constexpr auto zeroth_degree_Celsius = ice_point; + constexpr struct degree_Celsius final : named_unit {} degree_Celsius; ``` === "Before" ```cpp - inline constexpr struct dim_length : base_dimension<"L"> {} dim_length; - inline constexpr struct length : quantity_spec {} length; + constexpr struct dim_length : base_dimension<"L"> {} dim_length; + constexpr struct length : quantity_spec {} length; - inline constexpr struct absolute_zero : absolute_point_origin {} absolute_zero; - inline constexpr struct zeroth_kelvin : decltype(absolute_zero) {} zeroth_kelvin; - inline constexpr struct kelvin : named_unit<"K", kind_of, zeroth_kelvin> {} kelvin; + constexpr struct absolute_zero : absolute_point_origin {} absolute_zero; + constexpr struct zeroth_kelvin : decltype(absolute_zero) {} zeroth_kelvin; + constexpr struct kelvin : named_unit<"K", kind_of, zeroth_kelvin> {} kelvin; - inline constexpr struct ice_point : relative_point_origin}> {} ice_point; - inline constexpr struct zeroth_degree_Celsius : decltype(ice_point) {} zeroth_degree_Celsius; - inline constexpr struct degree_Celsius : named_unit {} degree_Celsius; + constexpr struct ice_point : relative_point_origin}> {} ice_point; + constexpr struct zeroth_degree_Celsius : decltype(ice_point) {} zeroth_degree_Celsius; + constexpr struct degree_Celsius : named_unit {} degree_Celsius; ``` Please also note, that the `absolute_point_origin` does not use CRTP idiom anymore (:boom: **breaking change** :boom:). @@ -509,13 +509,13 @@ conversion factor. Here is a comparison of the code with previous and current de === "Now" ```cpp - inline constexpr struct yard final : named_unit<"yd", mag_ratio<9'144, 10'000> * si::metre> {} yard; - inline constexpr struct foot final : named_unit<"ft", mag_ratio<1, 3> * yard> {} foot; + constexpr struct yard final : named_unit<"yd", mag_ratio<9'144, 10'000> * si::metre> {} yard; + constexpr struct foot final : named_unit<"ft", mag_ratio<1, 3> * yard> {} foot; ``` === "Before" ```cpp - inline constexpr struct yard : named_unit<"yd", mag * si::metre> {} yard; - inline constexpr struct foot : named_unit<"ft", mag * yard> {} foot; + constexpr struct yard : named_unit<"yd", mag * si::metre> {} yard; + constexpr struct foot : named_unit<"ft", mag * yard> {} foot; ``` diff --git a/docs/index.md b/docs/index.md index 260316e1..bfd1a221 100644 --- a/docs/index.md +++ b/docs/index.md @@ -33,7 +33,7 @@ The library source code is hosted on [GitHub](https://github.com/mpusz/mp-units) using namespace mp_units; - inline constexpr struct smoot final : named_unit<"smoot", mag<67> * usc::inch> {} smoot; + constexpr struct smoot final : named_unit<"smoot", mag<67> * usc::inch> {} smoot; int main() { @@ -53,7 +53,7 @@ The library source code is hosted on [GitHub](https://github.com/mpusz/mp-units) using namespace mp_units; - inline constexpr struct smoot final : named_unit<"smoot", mag<67> * usc::inch> {} smoot; + constexpr struct smoot final : named_unit<"smoot", mag<67> * usc::inch> {} smoot; int main() { diff --git a/docs/users_guide/framework_basics/character_of_a_quantity.md b/docs/users_guide/framework_basics/character_of_a_quantity.md index 26b358af..3934cfda 100644 --- a/docs/users_guide/framework_basics/character_of_a_quantity.md +++ b/docs/users_guide/framework_basics/character_of_a_quantity.md @@ -97,15 +97,15 @@ enumeration can be appended to the `quantity_spec` describing such a quantity ty === "C++23" ```cpp - inline constexpr struct position_vector final : quantity_spec {} position_vector; - inline constexpr struct displacement final : quantity_spec {} displacement; + constexpr struct position_vector final : quantity_spec {} position_vector; + constexpr struct displacement final : quantity_spec {} displacement; ``` === "C++20" ```cpp - inline constexpr struct position_vector final : quantity_spec {} position_vector; - inline constexpr struct displacement final : quantity_spec {} displacement; + constexpr struct position_vector final : quantity_spec {} position_vector; + constexpr struct displacement final : quantity_spec {} displacement; ``` === "Portable" @@ -126,13 +126,13 @@ character override is needed): === "C++23" ```cpp - inline constexpr struct velocity final : quantity_spec {} velocity; + constexpr struct velocity final : quantity_spec {} velocity; ``` === "C++20" ```cpp - inline constexpr struct velocity final : quantity_spec {} velocity; + constexpr struct velocity final : quantity_spec {} velocity; ``` === "Portable" @@ -179,7 +179,7 @@ For example, here is how it can be done for the [P1385](https://wg21.link/p1385) using la_vector = STD_LA::fixed_size_column_vector; template<> -inline constexpr bool mp_units::is_vector = true; +constexpr bool mp_units::is_vector = true; ``` With the above, we can use `la_vector` as a representation type for our quantity: @@ -233,7 +233,7 @@ For example, we can do the following: ```cpp template requires mp_units::is_scalar -inline constexpr bool mp_units::is_vector = true; +constexpr bool mp_units::is_vector = true; ``` which says that every type that can be used as a scalar representation is also allowed for vector diff --git a/docs/users_guide/framework_basics/concepts.md b/docs/users_guide/framework_basics/concepts.md index dd09e673..1fce6016 100644 --- a/docs/users_guide/framework_basics/concepts.md +++ b/docs/users_guide/framework_basics/concepts.md @@ -180,7 +180,7 @@ with `true` for one or more of the following variable templates: ```cpp template requires mp_units::is_scalar - inline constexpr bool mp_units::is_vector = true; + constexpr bool mp_units::is_vector = true; ``` @@ -219,7 +219,7 @@ implicitly convertible from quantity specification `V`, which means that `V` mus However, if we define `mean_sea_level` in the following way: ```cpp - inline constexpr struct mean_sea_level final : absolute_point_origin {} mean_sea_level; + constexpr struct mean_sea_level final : absolute_point_origin {} mean_sea_level; ``` then it can't be used as a point origin for _points_ of `isq::length` or `isq::width` as none of them diff --git a/docs/users_guide/framework_basics/design_overview.md b/docs/users_guide/framework_basics/design_overview.md index 4d2f9850..c820c1a6 100644 --- a/docs/users_guide/framework_basics/design_overview.md +++ b/docs/users_guide/framework_basics/design_overview.md @@ -60,8 +60,8 @@ For example: the following way: ```cpp -inline constexpr struct dim_length final : base_dimension<"L"> {} dim_length; -inline constexpr struct dim_time final : base_dimension<"T"> {} dim_time; +constexpr struct dim_length final : base_dimension<"L"> {} dim_length; +constexpr struct dim_time final : base_dimension<"T"> {} dim_time; ``` [Derived dimensions](../../appendix/glossary.md#derived-dimension) are implicitly created @@ -71,9 +71,9 @@ provided in the [quantity specification](../../appendix/glossary.md#quantity_spe === "C++23" ```cpp - inline constexpr struct length final : quantity_spec {} length; - inline constexpr struct time final : quantity_spec {} time; - inline constexpr struct speed final : quantity_spec {} speed; + constexpr struct length final : quantity_spec {} length; + constexpr struct time final : quantity_spec {} time; + constexpr struct speed final : quantity_spec {} speed; static_assert(speed.dimension == dim_length / dim_time); ``` @@ -81,9 +81,9 @@ provided in the [quantity specification](../../appendix/glossary.md#quantity_spe === "C++20" ```cpp - inline constexpr struct length final : quantity_spec {} length; - inline constexpr struct time final : quantity_spec {} time; - inline constexpr struct speed final : quantity_spec {} speed; + constexpr struct length final : quantity_spec {} length; + constexpr struct time final : quantity_spec {} time; + constexpr struct speed final : quantity_spec {} speed; static_assert(speed.dimension == dim_length / dim_time); ``` @@ -183,17 +183,17 @@ Quantity specification can be defined by the user in one of the following ways: === "C++23" ```cpp - inline constexpr struct length final : quantity_spec {} length; - inline constexpr struct height final : quantity_spec {} height; - inline constexpr struct speed final : quantity_spec {} speed; + constexpr struct length final : quantity_spec {} length; + constexpr struct height final : quantity_spec {} height; + constexpr struct speed final : quantity_spec {} speed; ``` === "C++20" ```cpp - inline constexpr struct length final : quantity_spec {} length; - inline constexpr struct height final : quantity_spec {} height; - inline constexpr struct speed final : quantity_spec {} speed; + constexpr struct length final : quantity_spec {} length; + constexpr struct height final : quantity_spec {} height; + constexpr struct speed final : quantity_spec {} speed; ``` === "Portable" @@ -232,15 +232,15 @@ A unit can be defined by the user in one of the following ways: ```cpp template struct kilo_ : prefixed_unit<"k", mag_power<10, 3>, U{}> {}; -template inline constexpr kilo_ kilo; +template constexpr kilo_ kilo; -inline constexpr struct second final : named_unit<"s", kind_of> {} second; -inline constexpr struct minute final : named_unit<"min", mag<60> * second> {} minute; -inline constexpr struct gram final : named_unit<"g", kind_of> {} gram; -inline constexpr auto kilogram = kilo; -inline constexpr struct newton final : named_unit<"N", kilogram * metre / square(second)> {} newton; +constexpr struct second final : named_unit<"s", kind_of> {} second; +constexpr struct minute final : named_unit<"min", mag<60> * second> {} minute; +constexpr struct gram final : named_unit<"g", kind_of> {} gram; +constexpr auto kilogram = kilo; +constexpr struct newton final : named_unit<"N", kilogram * metre / square(second)> {} newton; -inline constexpr struct speed_of_light_in_vacuum final : named_unit<"c", mag<299'792'458> * metre / second> {} speed_of_light_in_vacuum; +constexpr struct speed_of_light_in_vacuum final : named_unit<"c", mag<299'792'458> * metre / second> {} speed_of_light_in_vacuum; ``` The [unit equation](../../appendix/glossary.md#unit-equation) of `si::metre / si::second` results @@ -346,13 +346,13 @@ For example: - the absolute point origin can be defined in the following way: ```cpp - inline constexpr struct absolute_zero final : absolute_point_origin {} absolute_zero; + constexpr struct absolute_zero final : absolute_point_origin {} absolute_zero; ``` - the relative point origin can be defined in the following way: ```cpp - inline constexpr struct ice_point final : relative_point_origin> {} ice_point; + constexpr struct ice_point final : relative_point_origin> {} ice_point; ``` diff --git a/docs/users_guide/framework_basics/dimensionless_quantities.md b/docs/users_guide/framework_basics/dimensionless_quantities.md index 3cb3d089..2c997222 100644 --- a/docs/users_guide/framework_basics/dimensionless_quantities.md +++ b/docs/users_guide/framework_basics/dimensionless_quantities.md @@ -113,7 +113,7 @@ that uses a unit that is proportional to the ratio of kilometers per megaparsecs units of _length_: ```cpp -inline constexpr struct hubble_constant final : +constexpr struct hubble_constant final : named_unit<{u8"H₀", "H_0"}, mag_ratio<701, 10> * si::kilo / si::second / si::mega> {} hubble_constant; ``` @@ -158,10 +158,10 @@ Besides the unit `one`, there are a few other scaled units predefined in the lib with dimensionless quantities: ```cpp -inline constexpr struct percent final : named_unit<"%", mag_ratio<1, 100> * one> {} percent; -inline constexpr struct per_mille final : named_unit<{u8"‰", "%o"}, mag_ratio<1, 1000> * one> {} per_mille; -inline constexpr struct parts_per_million final : named_unit<"ppm", mag_ratio<1, 1'000'000> * one> {} parts_per_million; -inline constexpr auto ppm = parts_per_million; +constexpr struct percent final : named_unit<"%", mag_ratio<1, 100> * one> {} percent; +constexpr struct per_mille final : named_unit<{u8"‰", "%o"}, mag_ratio<1, 1000> * one> {} per_mille; +constexpr struct parts_per_million final : named_unit<"ppm", mag_ratio<1, 1'000'000> * one> {} parts_per_million; +constexpr auto ppm = parts_per_million; ``` ### Superpowers of the unit `one` @@ -271,17 +271,17 @@ to the quantity specification: === "C++23" ```cpp - inline constexpr struct angular_measure final : quantity_spec {} angular_measure; - inline constexpr struct solid_angular_measure final : quantity_spec(radius), is_kind> {} solid_angular_measure; - inline constexpr struct storage_capacity final : quantity_spec {} storage_capacity; + constexpr struct angular_measure final : quantity_spec {} angular_measure; + constexpr struct solid_angular_measure final : quantity_spec(radius), is_kind> {} solid_angular_measure; + constexpr struct storage_capacity final : quantity_spec {} storage_capacity; ``` === "C++20" ```cpp - inline constexpr struct angular_measure final : quantity_spec {} angular_measure; - inline constexpr struct solid_angular_measure final : quantity_spec(radius), is_kind> {} solid_angular_measure; - inline constexpr struct storage_capacity final : quantity_spec {} storage_capacity; + constexpr struct angular_measure final : quantity_spec {} angular_measure; + constexpr struct solid_angular_measure final : quantity_spec(radius), is_kind> {} solid_angular_measure; + constexpr struct storage_capacity final : quantity_spec {} storage_capacity; ``` === "Portable" @@ -296,9 +296,9 @@ With the above, we can constrain `radian`, `steradian`, and `bit` to be allowed specific quantity kinds only: ```cpp -inline constexpr struct radian final : named_unit<"rad", metre / metre, kind_of> {} radian; -inline constexpr struct steradian final : named_unit<"sr", square(metre) / square(metre), kind_of> {} steradian; -inline constexpr struct bit final : named_unit<"bit", one, kind_of> {} bit; +constexpr struct radian final : named_unit<"rad", metre / metre, kind_of> {} radian; +constexpr struct steradian final : named_unit<"sr", square(metre) / square(metre), kind_of> {} steradian; +constexpr struct bit final : named_unit<"bit", one, kind_of> {} bit; ``` but still allow the usage of `one` and its scaled versions for such quantities. diff --git a/docs/users_guide/framework_basics/faster_than_lightspeed_constants.md b/docs/users_guide/framework_basics/faster_than_lightspeed_constants.md index cef490db..5dd8c3eb 100644 --- a/docs/users_guide/framework_basics/faster_than_lightspeed_constants.md +++ b/docs/users_guide/framework_basics/faster_than_lightspeed_constants.md @@ -39,12 +39,12 @@ namespace si { namespace si2019 { -inline constexpr struct speed_of_light_in_vacuum final : +constexpr struct speed_of_light_in_vacuum final : named_unit<"c", mag<299'792'458> * metre / second> {} speed_of_light_in_vacuum; } // namespace si2019 -inline constexpr struct magnetic_constant final : +constexpr struct magnetic_constant final : named_unit<{u8"μ₀", "u_0"}, mag<4> * mag_pi * mag_power<10, -7> * henry / metre> {} magnetic_constant; } // namespace mp_units::si diff --git a/docs/users_guide/framework_basics/interface_introduction.md b/docs/users_guide/framework_basics/interface_introduction.md index 31ebef0a..b7c6a2e5 100644 --- a/docs/users_guide/framework_basics/interface_introduction.md +++ b/docs/users_guide/framework_basics/interface_introduction.md @@ -6,8 +6,8 @@ The **mp-units** library decided to use a rather unusual pattern to define entit Here is how we define `metre` and `second` [SI](../../appendix/glossary.md#si) base units: ```cpp -inline constexpr struct metre final : named_unit<"m", kind_of> {} metre; -inline constexpr struct second final : named_unit<"s", kind_of> {} second; +constexpr struct metre final : named_unit<"m", kind_of> {} metre; +constexpr struct second final : named_unit<"s", kind_of> {} second; ``` Please note that the above reuses the same identifier for a type and its value. The rationale @@ -97,9 +97,9 @@ the value-based [unit equation](../../appendix/glossary.md#unit-equation) to a c definition: ```cpp -inline constexpr struct newton final : named_unit<"N", kilogram * metre / square(second)> {} newton; -inline constexpr struct pascal final : named_unit<"Pa", newton / square(metre)> {} pascal; -inline constexpr struct joule final : named_unit<"J", newton * metre> {} joule; +constexpr struct newton final : named_unit<"N", kilogram * metre / square(second)> {} newton; +constexpr struct pascal final : named_unit<"Pa", newton / square(metre)> {} pascal; +constexpr struct joule final : named_unit<"J", newton * metre> {} joule; ``` diff --git a/docs/users_guide/framework_basics/simple_and_typed_quantities.md b/docs/users_guide/framework_basics/simple_and_typed_quantities.md index 178c36e2..7dcf645d 100644 --- a/docs/users_guide/framework_basics/simple_and_typed_quantities.md +++ b/docs/users_guide/framework_basics/simple_and_typed_quantities.md @@ -316,12 +316,12 @@ Let's see another example: using namespace mp_units; // add a custom quantity type of kind isq::length - inline constexpr struct horizontal_length final : + constexpr struct horizontal_length final : quantity_spec {} horizontal_length; // add a custom derived quantity type of kind isq::area // with a constrained quantity equation - inline constexpr struct horizontal_area final : + constexpr struct horizontal_area final : quantity_spec {} horizontal_area; class StorageTank { @@ -429,12 +429,12 @@ Let's see another example: using namespace mp_units; // add a custom quantity type of kind isq::length - inline constexpr struct horizontal_length final : + constexpr struct horizontal_length final : quantity_spec {} horizontal_length; // add a custom derived quantity type of kind isq::area // with a constrained quantity equation - inline constexpr struct horizontal_area final : + constexpr struct horizontal_area final : quantity_spec {} horizontal_area; class StorageTank { diff --git a/docs/users_guide/framework_basics/systems_of_quantities.md b/docs/users_guide/framework_basics/systems_of_quantities.md index 438de213..fb9ee547 100644 --- a/docs/users_guide/framework_basics/systems_of_quantities.md +++ b/docs/users_guide/framework_basics/systems_of_quantities.md @@ -148,45 +148,45 @@ For example, here is how the above quantity kind tree can be modeled in the libr === "C++23" ```cpp - inline constexpr struct length final : quantity_spec {} length; - inline constexpr struct width final : quantity_spec {} width; - inline constexpr auto breadth = width; - inline constexpr struct height final : quantity_spec {} height; - inline constexpr auto depth = height; - inline constexpr auto altitude = height; - inline constexpr struct thickness final : quantity_spec {} thickness; - inline constexpr struct diameter final : quantity_spec {} diameter; - inline constexpr struct radius final : quantity_spec {} radius; - inline constexpr struct radius_of_curvature final : quantity_spec {} radius_of_curvature; - inline constexpr struct path_length final : quantity_spec {} path_length; - inline constexpr auto arc_length = path_length; - inline constexpr struct distance final : quantity_spec {} distance; - inline constexpr struct radial_distance final : quantity_spec {} radial_distance; - inline constexpr struct wavelength final : quantity_spec {} wavelength; - inline constexpr struct position_vector final : quantity_spec {} position_vector; - inline constexpr struct displacement final : quantity_spec {} displacement; + constexpr struct length final : quantity_spec {} length; + constexpr struct width final : quantity_spec {} width; + constexpr auto breadth = width; + constexpr struct height final : quantity_spec {} height; + constexpr auto depth = height; + constexpr auto altitude = height; + constexpr struct thickness final : quantity_spec {} thickness; + constexpr struct diameter final : quantity_spec {} diameter; + constexpr struct radius final : quantity_spec {} radius; + constexpr struct radius_of_curvature final : quantity_spec {} radius_of_curvature; + constexpr struct path_length final : quantity_spec {} path_length; + constexpr auto arc_length = path_length; + constexpr struct distance final : quantity_spec {} distance; + constexpr struct radial_distance final : quantity_spec {} radial_distance; + constexpr struct wavelength final : quantity_spec {} wavelength; + constexpr struct position_vector final : quantity_spec {} position_vector; + constexpr struct displacement final : quantity_spec {} displacement; ``` === "C++20" ```cpp - inline constexpr struct length final : quantity_spec {} length; - inline constexpr struct width final : quantity_spec {} width; - inline constexpr auto breadth = width; - inline constexpr struct height final : quantity_spec {} height; - inline constexpr auto depth = height; - inline constexpr auto altitude = height; - inline constexpr struct thickness final : quantity_spec {} thickness; - inline constexpr struct diameter final : quantity_spec {} diameter; - inline constexpr struct radius final : quantity_spec {} radius; - inline constexpr struct radius_of_curvature final : quantity_spec {} radius_of_curvature; - inline constexpr struct path_length final : quantity_spec {} path_length; - inline constexpr auto arc_length = path_length; - inline constexpr struct distance final : quantity_spec {} distance; - inline constexpr struct radial_distance final : quantity_spec {} radial_distance; - inline constexpr struct wavelength final : quantity_spec {} wavelength; - inline constexpr struct position_vector final : quantity_spec {} position_vector; - inline constexpr struct displacement final : quantity_spec {} displacement; + constexpr struct length final : quantity_spec {} length; + constexpr struct width final : quantity_spec {} width; + constexpr auto breadth = width; + constexpr struct height final : quantity_spec {} height; + constexpr auto depth = height; + constexpr auto altitude = height; + constexpr struct thickness final : quantity_spec {} thickness; + constexpr struct diameter final : quantity_spec {} diameter; + constexpr struct radius final : quantity_spec {} radius; + constexpr struct radius_of_curvature final : quantity_spec {} radius_of_curvature; + constexpr struct path_length final : quantity_spec {} path_length; + constexpr auto arc_length = path_length; + constexpr struct distance final : quantity_spec {} distance; + constexpr struct radial_distance final : quantity_spec {} radial_distance; + constexpr struct wavelength final : quantity_spec {} wavelength; + constexpr struct position_vector final : quantity_spec {} position_vector; + constexpr struct displacement final : quantity_spec {} displacement; ``` === "Portable" @@ -194,16 +194,16 @@ For example, here is how the above quantity kind tree can be modeled in the libr ```cpp QUANTITY_SPEC(length, dim_length); QUANTITY_SPEC(width, length); - inline constexpr auto breadth = width; + constexpr auto breadth = width; QUANTITY_SPEC(height, length); - inline constexpr auto depth = height; - inline constexpr auto altitude = height; + constexpr auto depth = height; + constexpr auto altitude = height; QUANTITY_SPEC(thickness, width); QUANTITY_SPEC(diameter, width); QUANTITY_SPEC(radius, width); QUANTITY_SPEC(radius_of_curvature, radius); QUANTITY_SPEC(path_length, length); - inline constexpr auto arc_length = path_length; + constexpr auto arc_length = path_length; QUANTITY_SPEC(distance, path_length); QUANTITY_SPEC(radial_distance, distance); QUANTITY_SPEC(wavelength, length); diff --git a/docs/users_guide/framework_basics/systems_of_units.md b/docs/users_guide/framework_basics/systems_of_units.md index df37b6bf..a5573ddc 100644 --- a/docs/users_guide/framework_basics/systems_of_units.md +++ b/docs/users_guide/framework_basics/systems_of_units.md @@ -26,7 +26,7 @@ this is expressed by associating a quantity kind (that we discussed in detail in previous chapter) with a unit that is used to express it: ```cpp -inline constexpr struct metre final : named_unit<"m", kind_of> {} metre; +constexpr struct metre final : named_unit<"m", kind_of> {} metre; ``` !!! important @@ -67,7 +67,7 @@ of a specific predefined [unit equation](../../appendix/glossary.md#unit-equatio For example, a unit of _power_ quantity is defined in the library as: ```cpp -inline constexpr struct watt final : named_unit<"W", joule / second> {} watt; +constexpr struct watt final : named_unit<"W", joule / second> {} watt; ``` However, a _power_ quantity can be expressed in other units as well. For example, @@ -110,8 +110,8 @@ The library allows constraining such units to work only with quantities of a spe the following way: ```cpp -inline constexpr struct hertz final : named_unit<"Hz", one / second, kind_of> {} hertz; -inline constexpr struct becquerel final : named_unit<"Bq", one / second, kind_of> {} becquerel; +constexpr struct hertz final : named_unit<"Hz", one / second, kind_of> {} hertz; +constexpr struct becquerel final : named_unit<"Bq", one / second, kind_of> {} becquerel; ``` With the above, `hertz` can only be used with _frequencies_, while `becquerel` should only be used with @@ -138,14 +138,14 @@ Each prefix is implemented similarly to the following: ```cpp template struct quecto_ : prefixed_unit<"q", mag_power<10, -30>, U{}> {}; -template inline constexpr quecto_ quecto; +template constexpr quecto_ quecto; ``` and then a [PrefixableUnit](concepts.md#PrefixableUnit) can be prefixed in the following way: ```cpp -inline constexpr auto qm = quecto; +constexpr auto qm = quecto; ``` The usage of `mag_power` not only enables providing support for SI prefixes, but it can also @@ -154,7 +154,7 @@ IT industry can be implemented as: ```cpp template struct yobi_ : prefixed_unit<"Yi", mag_power<2, 80>, U{}> {}; -template inline constexpr yobi_ yobi; +template constexpr yobi_ yobi; ``` ## Scaled units @@ -168,25 +168,25 @@ be explicitly expressed with predefined SI prefixes. Those include units like mi electronvolt: ```cpp -inline constexpr struct minute final : named_unit<"min", mag<60> * si::second> {} minute; -inline constexpr struct hour final : named_unit<"h", mag<60> * minute> {} hour; -inline constexpr struct electronvolt final : named_unit<"eV", mag_ratio<1'602'176'634, 1'000'000'000> * mag_power<10, -19> * si::joule> {} electronvolt; +constexpr struct minute final : named_unit<"min", mag<60> * si::second> {} minute; +constexpr struct hour final : named_unit<"h", mag<60> * minute> {} hour; +constexpr struct electronvolt final : named_unit<"eV", mag_ratio<1'602'176'634, 1'000'000'000> * mag_power<10, -19> * si::joule> {} electronvolt; ``` Also, units of other [systems of units](../../appendix/glossary.md#system-of-units) are often defined in terms of scaled versions of the SI units. For example, the international yard is defined as: ```cpp -inline constexpr struct yard final : named_unit<"yd", mag_ratio<9'144, 10'000> * si::metre> {} yard; +constexpr struct yard final : named_unit<"yd", mag_ratio<9'144, 10'000> * si::metre> {} yard; ``` For some units, a magnitude might also be irrational. The best example here is a `degree` which is defined using a floating-point magnitude having a factor of the number π (Pi): ```cpp -inline constexpr struct mag_pi final : magnitude> {} mag_pi; +constexpr struct mag_pi final : magnitude> {} mag_pi; ``` ```cpp -inline constexpr struct degree final : named_unit<{u8"°", "deg"}, mag_pi / mag<180> * si::radian> {} degree; +constexpr struct degree final : named_unit<{u8"°", "deg"}, mag_pi / mag<180> * si::radian> {} degree; ``` diff --git a/docs/users_guide/framework_basics/text_output.md b/docs/users_guide/framework_basics/text_output.md index cc6c347d..0a7d7981 100644 --- a/docs/users_guide/framework_basics/text_output.md +++ b/docs/users_guide/framework_basics/text_output.md @@ -33,30 +33,30 @@ and units of derived quantities. === "Dimensions" ```cpp - inline constexpr struct dim_length final : base_dimension<"L"> {} dim_length; - inline constexpr struct dim_mass final : base_dimension<"M"> {} dim_mass; - inline constexpr struct dim_time final : base_dimension<"T"> {} dim_time; - inline constexpr struct dim_electric_current final : base_dimension<"I"> {} dim_electric_current; - inline constexpr struct dim_thermodynamic_temperature final : base_dimension<{u8"Θ", "O"}> {} dim_thermodynamic_temperature; - inline constexpr struct dim_amount_of_substance final : base_dimension<"N"> {} dim_amount_of_substance; - inline constexpr struct dim_luminous_intensity final : base_dimension<"J"> {} dim_luminous_intensity; + constexpr struct dim_length final : base_dimension<"L"> {} dim_length; + constexpr struct dim_mass final : base_dimension<"M"> {} dim_mass; + constexpr struct dim_time final : base_dimension<"T"> {} dim_time; + constexpr struct dim_electric_current final : base_dimension<"I"> {} dim_electric_current; + constexpr struct dim_thermodynamic_temperature final : base_dimension<{u8"Θ", "O"}> {} dim_thermodynamic_temperature; + constexpr struct dim_amount_of_substance final : base_dimension<"N"> {} dim_amount_of_substance; + constexpr struct dim_luminous_intensity final : base_dimension<"J"> {} dim_luminous_intensity; ``` === "Units" ```cpp - inline constexpr struct second final : named_unit<"s", kind_of> {} second; - inline constexpr struct metre final : named_unit<"m", kind_of> {} metre; - inline constexpr struct gram final : named_unit<"g", kind_of> {} gram; - inline constexpr auto kilogram = kilo; + constexpr struct second final : named_unit<"s", kind_of> {} second; + constexpr struct metre final : named_unit<"m", kind_of> {} metre; + constexpr struct gram final : named_unit<"g", kind_of> {} gram; + constexpr auto kilogram = kilo; - inline constexpr struct newton final : named_unit<"N", kilogram * metre / square(second)> {} newton; - inline constexpr struct joule final : named_unit<"J", newton * metre> {} joule; - inline constexpr struct watt final : named_unit<"W", joule / second> {} watt; - inline constexpr struct coulomb final : named_unit<"C", ampere * second> {} coulomb; - inline constexpr struct volt final : named_unit<"V", watt / ampere> {} volt; - inline constexpr struct farad final : named_unit<"F", coulomb / volt> {} farad; - inline constexpr struct ohm final : named_unit<{u8"Ω", "ohm"}, volt / ampere> {} ohm; + constexpr struct newton final : named_unit<"N", kilogram * metre / square(second)> {} newton; + constexpr struct joule final : named_unit<"J", newton * metre> {} joule; + constexpr struct watt final : named_unit<"W", joule / second> {} watt; + constexpr struct coulomb final : named_unit<"C", ampere * second> {} coulomb; + constexpr struct volt final : named_unit<"V", watt / ampere> {} volt; + constexpr struct farad final : named_unit<"F", coulomb / volt> {} farad; + constexpr struct ohm final : named_unit<{u8"Ω", "ohm"}, volt / ampere> {} ohm; ``` === "Prefixes" @@ -75,13 +75,13 @@ and units of derived quantities. === "Constants" ```cpp - inline constexpr struct hyperfine_structure_transition_frequency_of_cs final : named_unit<{u8"Δν_Cs", "dv_Cs"}, mag<9'192'631'770> * hertz> {} hyperfine_structure_transition_frequency_of_cs; - inline constexpr struct speed_of_light_in_vacuum final : named_unit<"c", mag<299'792'458> * metre / second> {} speed_of_light_in_vacuum; - inline constexpr struct planck_constant final : named_unit<"h", mag_ratio<662'607'015, 100'000'000> * mag_power<10, -34> * joule * second> {} planck_constant; - inline constexpr struct elementary_charge final : named_unit<"e", mag_ratio<1'602'176'634, 1'000'000'000> * mag_power<10, -19> * coulomb> {} elementary_charge; - inline constexpr struct boltzmann_constant final : named_unit<"k", mag_ratio<1'380'649, 1'000'000> * mag_power<10, -23> * joule / kelvin> {} boltzmann_constant; - inline constexpr struct avogadro_constant final : named_unit<"N_A", mag_ratio<602'214'076, 100'000'000> * mag_power<10, 23> / mole> {} avogadro_constant; - inline constexpr struct luminous_efficacy final : named_unit<"K_cd", mag<683> * lumen / watt> {} luminous_efficacy; + constexpr struct hyperfine_structure_transition_frequency_of_cs final : named_unit<{u8"Δν_Cs", "dv_Cs"}, mag<9'192'631'770> * hertz> {} hyperfine_structure_transition_frequency_of_cs; + constexpr struct speed_of_light_in_vacuum final : named_unit<"c", mag<299'792'458> * metre / second> {} speed_of_light_in_vacuum; + constexpr struct planck_constant final : named_unit<"h", mag_ratio<662'607'015, 100'000'000> * mag_power<10, -34> * joule * second> {} planck_constant; + constexpr struct elementary_charge final : named_unit<"e", mag_ratio<1'602'176'634, 1'000'000'000> * mag_power<10, -19> * coulomb> {} elementary_charge; + constexpr struct boltzmann_constant final : named_unit<"k", mag_ratio<1'380'649, 1'000'000> * mag_power<10, -23> * joule / kelvin> {} boltzmann_constant; + constexpr struct avogadro_constant final : named_unit<"N_A", mag_ratio<602'214'076, 100'000'000> * mag_power<10, 23> / mole> {} avogadro_constant; + constexpr struct luminous_efficacy final : named_unit<"K_cd", mag<683> * lumen / watt> {} luminous_efficacy; ``` !!! important @@ -105,7 +105,7 @@ and units of derived quantities. template name to initialize it with two symbols: ```cpp - inline constexpr struct ohm final : named_unit {} ohm; + constexpr struct ohm final : named_unit {} ohm; ``` @@ -288,7 +288,7 @@ specialization for a specific unit: ```cpp template<> -inline constexpr bool space_before_unit_symbol = false; +constexpr bool space_before_unit_symbol = false; ``` !!! note diff --git a/docs/users_guide/framework_basics/the_affine_space.md b/docs/users_guide/framework_basics/the_affine_space.md index 688c4379..7e760aca 100644 --- a/docs/users_guide/framework_basics/the_affine_space.md +++ b/docs/users_guide/framework_basics/the_affine_space.md @@ -196,7 +196,7 @@ origin. ![affine_space_2](affine_space_2.svg){style="width:80%;display: block;margin: 0 auto;"} ```cpp -inline constexpr struct origin final : absolute_point_origin {} origin; +constexpr struct origin final : absolute_point_origin {} origin; // quantity_point qp1{100 * m}; // Compile-time error // quantity_point qp2{delta(120)}; // Compile-time error @@ -265,8 +265,8 @@ type and unit is being used: ![affine_space_3](affine_space_3.svg){style="width:80%;display: block;margin: 0 auto;"} ```cpp -inline constexpr struct origin1 final : absolute_point_origin {} origin1; -inline constexpr struct origin2 final : absolute_point_origin {} origin2; +constexpr struct origin1 final : absolute_point_origin {} origin1; +constexpr struct origin2 final : absolute_point_origin {} origin2; quantity_point qp1 = origin1 + 100 * m; quantity_point qp2 = origin2 + 120 * m; @@ -300,10 +300,10 @@ For such cases, relative point origins should be used: ![affine_space_4](affine_space_4.svg){style="width:80%;display: block;margin: 0 auto;"} ```cpp -inline constexpr struct A final : absolute_point_origin {} A; -inline constexpr struct B final : relative_point_origin {} B; -inline constexpr struct C final : relative_point_origin {} C; -inline constexpr struct D final : relative_point_origin {} D; +constexpr struct A final : absolute_point_origin {} A; +constexpr struct B final : relative_point_origin {} B; +constexpr struct C final : relative_point_origin {} C; +constexpr struct D final : relative_point_origin {} D; quantity_point qp1 = C + 100 * m; quantity_point qp2 = D + 120 * m; @@ -408,17 +408,17 @@ point origins for this purpose: ```cpp namespace si { -inline constexpr struct absolute_zero final : absolute_point_origin {} absolute_zero; -inline constexpr auto zeroth_kelvin = absolute_zero; +constexpr struct absolute_zero final : absolute_point_origin {} absolute_zero; +constexpr auto zeroth_kelvin = absolute_zero; -inline constexpr struct ice_point final : relative_point_origin>(273'150)}> {} ice_point; -inline constexpr auto zeroth_degree_Celsius = ice_point; +constexpr struct ice_point final : relative_point_origin>(273'150)}> {} ice_point; +constexpr auto zeroth_degree_Celsius = ice_point; } namespace usc { -inline constexpr struct zeroth_degree_Fahrenheit final : +constexpr struct zeroth_degree_Fahrenheit final : relative_point_origin * si::degree_Celsius>(-32)> {} zeroth_degree_Fahrenheit; } @@ -442,16 +442,16 @@ definitions: ```cpp namespace si { -inline constexpr struct kelvin final : +constexpr struct kelvin final : named_unit<"K", kind_of, zeroth_kelvin> {} kelvin; -inline constexpr struct degree_Celsius final : +constexpr struct degree_Celsius final : named_unit<{u8"℃", "`C"}, kelvin, zeroth_degree_Celsius> {} degree_Celsius; } namespace usc { -inline constexpr struct degree_Fahrenheit final : +constexpr struct degree_Fahrenheit final : named_unit<{u8"℉", "`F"}, mag_ratio<5, 9> * si::degree_Celsius, zeroth_degree_Fahrenheit> {} degree_Fahrenheit; diff --git a/docs/users_guide/framework_basics/value_conversions.md b/docs/users_guide/framework_basics/value_conversions.md index 1ec7e340..f22ad6aa 100644 --- a/docs/users_guide/framework_basics/value_conversions.md +++ b/docs/users_guide/framework_basics/value_conversions.md @@ -85,16 +85,16 @@ the `value_cast(q)` which always returns the most precise result: === "C++23" ```cpp - inline constexpr struct dim_currency final : base_dimension<"$"> {} dim_currency; - inline constexpr struct currency final : quantity_spec {} currency; + constexpr struct dim_currency final : base_dimension<"$"> {} dim_currency; + constexpr struct currency final : quantity_spec {} currency; - inline constexpr struct us_dollar final : named_unit<"USD", kind_of> {} us_dollar; - inline constexpr struct scaled_us_dollar final : named_unit<"USD_s", mag_power<10, -8> * us_dollar> {} scaled_us_dollar; + constexpr struct us_dollar final : named_unit<"USD", kind_of> {} us_dollar; + constexpr struct scaled_us_dollar final : named_unit<"USD_s", mag_power<10, -8> * us_dollar> {} scaled_us_dollar; namespace unit_symbols { - inline constexpr auto USD = us_dollar; - inline constexpr auto USD_s = scaled_us_dollar; + constexpr auto USD = us_dollar; + constexpr auto USD_s = scaled_us_dollar; } // namespace unit_symbols @@ -105,16 +105,16 @@ the `value_cast(q)` which always returns the most precise result: === "C++20" ```cpp - inline constexpr struct dim_currency final : base_dimension<"$"> {} dim_currency; - inline constexpr struct currency final : quantity_spec {} currency; + constexpr struct dim_currency final : base_dimension<"$"> {} dim_currency; + constexpr struct currency final : quantity_spec {} currency; - inline constexpr struct us_dollar final : named_unit<"USD", kind_of> {} us_dollar; - inline constexpr struct scaled_us_dollar final : named_unit<"USD_s", mag_power<10, -8> * us_dollar> {} scaled_us_dollar; + constexpr struct us_dollar final : named_unit<"USD", kind_of> {} us_dollar; + constexpr struct scaled_us_dollar final : named_unit<"USD_s", mag_power<10, -8> * us_dollar> {} scaled_us_dollar; namespace unit_symbols { - inline constexpr auto USD = us_dollar; - inline constexpr auto USD_s = scaled_us_dollar; + constexpr auto USD = us_dollar; + constexpr auto USD_s = scaled_us_dollar; } // namespace unit_symbols @@ -125,16 +125,16 @@ the `value_cast(q)` which always returns the most precise result: === "Portable" ```cpp - inline constexpr struct dim_currency final : base_dimension<"$"> {} dim_currency; + constexpr struct dim_currency final : base_dimension<"$"> {} dim_currency; QUANTITY_SPEC(currency, dim_currency); - inline constexpr struct us_dollar final : named_unit<"USD", kind_of> {} us_dollar; - inline constexpr struct scaled_us_dollar final : named_unit<"USD_s", mag_power<10, -8> * us_dollar> {} scaled_us_dollar; + constexpr struct us_dollar final : named_unit<"USD", kind_of> {} us_dollar; + constexpr struct scaled_us_dollar final : named_unit<"USD_s", mag_power<10, -8> * us_dollar> {} scaled_us_dollar; namespace unit_symbols { - inline constexpr auto USD = us_dollar; - inline constexpr auto USD_s = scaled_us_dollar; + constexpr auto USD = us_dollar; + constexpr auto USD_s = scaled_us_dollar; } // namespace unit_symbols diff --git a/docs/users_guide/use_cases/interoperability_with_other_libraries.md b/docs/users_guide/use_cases/interoperability_with_other_libraries.md index 07da96af..b449b02f 100644 --- a/docs/users_guide/use_cases/interoperability_with_other_libraries.md +++ b/docs/users_guide/use_cases/interoperability_with_other_libraries.md @@ -249,8 +249,8 @@ include the _mp-units/systems/si/chrono.h_ file to benefit from it. This file pr to the `std::chrono` abstractions: ```cpp - inline constexpr struct ts_origin final : relative_point_origin + 1 * h> {} ts_origin; - inline constexpr struct my_origin final : absolute_point_origin {} my_origin; + constexpr struct ts_origin final : relative_point_origin + 1 * h> {} ts_origin; + constexpr struct my_origin final : absolute_point_origin {} my_origin; quantity_point qp1 = sys_seconds{1s}; auto tp1 = to_chrono_time_point(qp1); // OK diff --git a/docs/users_guide/use_cases/wide_compatibility.md b/docs/users_guide/use_cases/wide_compatibility.md index b3420d12..22c968c1 100644 --- a/docs/users_guide/use_cases/wide_compatibility.md +++ b/docs/users_guide/use_cases/wide_compatibility.md @@ -29,7 +29,7 @@ your code using **mp-units**: // ... - inline constexpr struct horizontal_length final : quantity_spec {} horizontal_length; + constexpr struct horizontal_length final : quantity_spec {} horizontal_length; // ... @@ -45,7 +45,7 @@ your code using **mp-units**: // ... - inline constexpr struct horizontal_length final : quantity_spec {} horizontal_length; + constexpr struct horizontal_length final : quantity_spec {} horizontal_length; // ... @@ -65,7 +65,7 @@ your code using **mp-units**: // ... - inline constexpr struct horizontal_length final : quantity_spec {} horizontal_length; + constexpr struct horizontal_length final : quantity_spec {} horizontal_length; // ... @@ -85,7 +85,7 @@ your code using **mp-units**: // ... - inline constexpr struct horizontal_length final : quantity_spec {} horizontal_length; + constexpr struct horizontal_length final : quantity_spec {} horizontal_length; // ... diff --git a/example/currency.cpp b/example/currency.cpp index 6f280659..fcc0e0d5 100644 --- a/example/currency.cpp +++ b/example/currency.cpp @@ -40,22 +40,22 @@ import mp_units.core; using namespace mp_units; // clang-format off -inline constexpr struct dim_currency final : base_dimension<"$"> {} dim_currency; +constexpr struct dim_currency final : base_dimension<"$"> {} dim_currency; QUANTITY_SPEC(currency, dim_currency); -inline constexpr struct euro final : named_unit<"EUR", kind_of> {} euro; -inline constexpr struct us_dollar final : named_unit<"USD", kind_of> {} us_dollar; -inline constexpr struct great_british_pound final : named_unit<"GBP", kind_of> {} great_british_pound; -inline constexpr struct japanese_jen final : named_unit<"JPY", kind_of> {} japanese_jen; +constexpr struct euro final : named_unit<"EUR", kind_of> {} euro; +constexpr struct us_dollar final : named_unit<"USD", kind_of> {} us_dollar; +constexpr struct great_british_pound final : named_unit<"GBP", kind_of> {} great_british_pound; +constexpr struct japanese_jen final : named_unit<"JPY", kind_of> {} japanese_jen; // clang-format on namespace unit_symbols { -inline constexpr auto EUR = euro; -inline constexpr auto USD = us_dollar; -inline constexpr auto GBP = great_british_pound; -inline constexpr auto JPY = japanese_jen; +constexpr auto EUR = euro; +constexpr auto USD = us_dollar; +constexpr auto GBP = great_british_pound; +constexpr auto JPY = japanese_jen; } // namespace unit_symbols diff --git a/example/include/geographic.h b/example/include/geographic.h index ba26b3f1..9cbaaee1 100644 --- a/example/include/geographic.h +++ b/example/include/geographic.h @@ -44,7 +44,7 @@ import mp_units; namespace geographic { -inline constexpr struct mean_sea_level final : mp_units::absolute_point_origin { +constexpr struct mean_sea_level final : mp_units::absolute_point_origin { } mean_sea_level; using msl_altitude = mp_units::quantity_point; @@ -72,9 +72,9 @@ struct MP_UNITS_STD_FMT::formatter : namespace geographic { -inline constexpr struct equator final : mp_units::absolute_point_origin { +constexpr struct equator final : mp_units::absolute_point_origin { } equator; -inline constexpr struct prime_meridian final : mp_units::absolute_point_origin { +constexpr struct prime_meridian final : mp_units::absolute_point_origin { } prime_meridian; diff --git a/example/include/ranged_representation.h b/example/include/ranged_representation.h index 67557624..335f22dd 100644 --- a/example/include/ranged_representation.h +++ b/example/include/ranged_representation.h @@ -42,7 +42,7 @@ import mp_units.core; template) auto Min, MP_UNITS_CONSTRAINED_NTTP_WORKAROUND(std::convertible_to) auto Max> -inline constexpr auto is_in_range = [](const auto& v) { return std::clamp(v, T{Min}, T{Max}) == v; }; +constexpr auto is_in_range = [](const auto& v) { return std::clamp(v, T{Min}, T{Max}) == v; }; template) auto Min, MP_UNITS_CONSTRAINED_NTTP_WORKAROUND(std::convertible_to) auto Max> @@ -63,10 +63,10 @@ public: }; template -inline constexpr bool mp_units::is_scalar> = mp_units::is_scalar; +constexpr bool mp_units::is_scalar> = mp_units::is_scalar; template -inline constexpr bool mp_units::treat_as_floating_point> = +constexpr bool mp_units::treat_as_floating_point> = mp_units::treat_as_floating_point; template diff --git a/example/include/validated_type.h b/example/include/validated_type.h index efc1d946..0150c118 100644 --- a/example/include/validated_type.h +++ b/example/include/validated_type.h @@ -40,7 +40,7 @@ import mp_units.core; #include #endif -inline constexpr struct validated_tag { +constexpr struct validated_tag { } validated; template Validator> @@ -114,11 +114,10 @@ public: }; template -inline constexpr bool mp_units::is_scalar> = mp_units::is_scalar; +constexpr bool mp_units::is_scalar> = mp_units::is_scalar; template -inline constexpr bool mp_units::treat_as_floating_point> = - mp_units::treat_as_floating_point; +constexpr bool mp_units::treat_as_floating_point> = mp_units::treat_as_floating_point; template diff --git a/example/kalman_filter/kalman.h b/example/kalman_filter/kalman.h index 6e629477..90d0d506 100644 --- a/example/kalman_filter/kalman.h +++ b/example/kalman_filter/kalman.h @@ -47,13 +47,13 @@ namespace kalman { namespace detail { template -inline constexpr bool are_time_derivatives = false; +constexpr bool are_time_derivatives = false; template -inline constexpr bool are_time_derivatives = true; +constexpr bool are_time_derivatives = true; template -inline constexpr bool are_time_derivatives = +constexpr bool are_time_derivatives = (D1 / D2 == mp_units::isq::dim_time) && are_time_derivatives; } // namespace detail diff --git a/example/kalman_filter/kalman_filter-example_2.cpp b/example/kalman_filter/kalman_filter-example_2.cpp index daec350c..b03f8724 100644 --- a/example/kalman_filter/kalman_filter-example_2.cpp +++ b/example/kalman_filter/kalman_filter-example_2.cpp @@ -40,7 +40,7 @@ import mp_units; template requires mp_units::is_scalar -inline constexpr bool mp_units::is_vector = true; +constexpr bool mp_units::is_vector = true; using namespace mp_units; diff --git a/example/kalman_filter/kalman_filter-example_3.cpp b/example/kalman_filter/kalman_filter-example_3.cpp index 2e51cba1..9c2ca7d4 100644 --- a/example/kalman_filter/kalman_filter-example_3.cpp +++ b/example/kalman_filter/kalman_filter-example_3.cpp @@ -40,7 +40,7 @@ import mp_units; template requires mp_units::is_scalar -inline constexpr bool mp_units::is_vector = true; +constexpr bool mp_units::is_vector = true; using namespace mp_units; diff --git a/example/kalman_filter/kalman_filter-example_4.cpp b/example/kalman_filter/kalman_filter-example_4.cpp index f4df77a5..20813ad8 100644 --- a/example/kalman_filter/kalman_filter-example_4.cpp +++ b/example/kalman_filter/kalman_filter-example_4.cpp @@ -40,7 +40,7 @@ import mp_units; template requires mp_units::is_scalar -inline constexpr bool mp_units::is_vector = true; +constexpr bool mp_units::is_vector = true; using namespace mp_units; diff --git a/example/measurement.cpp b/example/measurement.cpp index 5e1e5419..d61c8d2e 100644 --- a/example/measurement.cpp +++ b/example/measurement.cpp @@ -132,12 +132,12 @@ private: } // namespace template -inline constexpr bool mp_units::treat_as_floating_point> = mp_units::treat_as_floating_point; +constexpr bool mp_units::treat_as_floating_point> = mp_units::treat_as_floating_point; template -inline constexpr bool mp_units::is_scalar> = true; +constexpr bool mp_units::is_scalar> = true; template -inline constexpr bool mp_units::is_vector> = true; +constexpr bool mp_units::is_vector> = true; static_assert(mp_units::RepresentationOf, mp_units::quantity_character::scalar>); diff --git a/example/si_constants.cpp b/example/si_constants.cpp index 022003f9..e09588c4 100644 --- a/example/si_constants.cpp +++ b/example/si_constants.cpp @@ -41,7 +41,7 @@ import mp_units; template requires mp_units::is_scalar -inline constexpr bool mp_units::is_vector = true; +constexpr bool mp_units::is_vector = true; int main() { diff --git a/example/storage_tank.cpp b/example/storage_tank.cpp index ad9f7580..2bb4f237 100644 --- a/example/storage_tank.cpp +++ b/example/storage_tank.cpp @@ -44,7 +44,7 @@ import mp_units; // types instead of requiring the usage of Linear Algebra library for this simple example template requires mp_units::is_scalar -inline constexpr bool mp_units::is_vector = true; +constexpr bool mp_units::is_vector = true; namespace { @@ -58,8 +58,8 @@ QUANTITY_SPEC(horizontal_length, isq::length); // with a constrained quantity equation QUANTITY_SPEC(horizontal_area, isq::area, horizontal_length* isq::width); -inline constexpr auto g = 1 * si::standard_gravity; -inline constexpr auto air_density = isq::mass_density(1.225 * kg / m3); +constexpr auto g = 1 * si::standard_gravity; +constexpr auto air_density = isq::mass_density(1.225 * kg / m3); class StorageTank { quantity base_; diff --git a/example/strong_angular_quantities.cpp b/example/strong_angular_quantities.cpp index 6487860d..9c03b36c 100644 --- a/example/strong_angular_quantities.cpp +++ b/example/strong_angular_quantities.cpp @@ -35,7 +35,7 @@ import mp_units; template requires mp_units::is_scalar -inline constexpr bool mp_units::is_vector = true; +constexpr bool mp_units::is_vector = true; int main() { diff --git a/example/total_energy.cpp b/example/total_energy.cpp index bcd149d6..75416bb7 100644 --- a/example/total_energy.cpp +++ b/example/total_energy.cpp @@ -39,7 +39,7 @@ import mp_units; template requires mp_units::is_scalar -inline constexpr bool mp_units::is_vector = true; +constexpr bool mp_units::is_vector = true; namespace { diff --git a/example/unmanned_aerial_vehicle.cpp b/example/unmanned_aerial_vehicle.cpp index 3e26ac08..2551110d 100644 --- a/example/unmanned_aerial_vehicle.cpp +++ b/example/unmanned_aerial_vehicle.cpp @@ -53,7 +53,7 @@ struct height_above_ellipsoid_t final : absolute_point_origin { static constexpr earth_gravity_model egm = M; }; template -inline constexpr height_above_ellipsoid_t height_above_ellipsoid; // NOLINT(google-readability-casting) +constexpr height_above_ellipsoid_t height_above_ellipsoid; // NOLINT(google-readability-casting) template using hae_altitude = quantity_point>; @@ -119,7 +119,7 @@ hae_altitude to_hae(msl_altitude msl, position pos) // **** HAL **** // clang-format off -inline constexpr struct height_above_launch final : absolute_point_origin {} height_above_launch; +constexpr struct height_above_launch final : absolute_point_origin {} height_above_launch; // clang-format on using hal_altitude = quantity_point; diff --git a/src/core/include/mp-units/bits/fmt.h b/src/core/include/mp-units/bits/fmt.h index c4572a9c..9889b971 100644 --- a/src/core/include/mp-units/bits/fmt.h +++ b/src/core/include/mp-units/bits/fmt.h @@ -122,7 +122,7 @@ public: MP_UNITS_EXPORT_END template -inline constexpr bool is_integer = +constexpr bool is_integer = std::is_integral_v && !std::is_same_v && !std::is_same_v && !std::is_same_v; // Converts a character to ASCII. Returns a number > 127 on conversion failure. diff --git a/src/core/include/mp-units/bits/hacks.h b/src/core/include/mp-units/bits/hacks.h index 5030debb..2c66f296 100644 --- a/src/core/include/mp-units/bits/hacks.h +++ b/src/core/include/mp-units/bits/hacks.h @@ -104,7 +104,7 @@ namespace std { struct from_range_t { explicit from_range_t() = default; }; -inline constexpr from_range_t from_range{}; +constexpr from_range_t from_range{}; } // namespace std diff --git a/src/core/include/mp-units/bits/text_tools.h b/src/core/include/mp-units/bits/text_tools.h index a01eb4a7..123ad858 100644 --- a/src/core/include/mp-units/bits/text_tools.h +++ b/src/core/include/mp-units/bits/text_tools.h @@ -40,32 +40,32 @@ namespace mp_units::detail { template requires(0 <= Value) && (Value < 10) -inline constexpr basic_fixed_string superscript_number = u8""; +constexpr basic_fixed_string superscript_number = u8""; template<> -inline constexpr basic_fixed_string superscript_number<0> = u8"\u2070"; +constexpr basic_fixed_string superscript_number<0> = u8"\u2070"; template<> -inline constexpr basic_fixed_string superscript_number<1> = u8"\u00b9"; +constexpr basic_fixed_string superscript_number<1> = u8"\u00b9"; template<> -inline constexpr basic_fixed_string superscript_number<2> = u8"\u00b2"; +constexpr basic_fixed_string superscript_number<2> = u8"\u00b2"; template<> -inline constexpr basic_fixed_string superscript_number<3> = u8"\u00b3"; +constexpr basic_fixed_string superscript_number<3> = u8"\u00b3"; template<> -inline constexpr basic_fixed_string superscript_number<4> = u8"\u2074"; +constexpr basic_fixed_string superscript_number<4> = u8"\u2074"; template<> -inline constexpr basic_fixed_string superscript_number<5> = u8"\u2075"; +constexpr basic_fixed_string superscript_number<5> = u8"\u2075"; template<> -inline constexpr basic_fixed_string superscript_number<6> = u8"\u2076"; +constexpr basic_fixed_string superscript_number<6> = u8"\u2076"; template<> -inline constexpr basic_fixed_string superscript_number<7> = u8"\u2077"; +constexpr basic_fixed_string superscript_number<7> = u8"\u2077"; template<> -inline constexpr basic_fixed_string superscript_number<8> = u8"\u2078"; +constexpr basic_fixed_string superscript_number<8> = u8"\u2078"; template<> -inline constexpr basic_fixed_string superscript_number<9> = u8"\u2079"; +constexpr basic_fixed_string superscript_number<9> = u8"\u2079"; -inline constexpr symbol_text superscript_minus(u8"\u207b", "-"); +constexpr symbol_text superscript_minus(u8"\u207b", "-"); -inline constexpr symbol_text superscript_prefix(u8"", "^"); +constexpr symbol_text superscript_prefix(u8"", "^"); template [[nodiscard]] consteval auto superscript_helper() diff --git a/src/core/include/mp-units/bits/type_list.h b/src/core/include/mp-units/bits/type_list.h index 203326c6..913a7a94 100644 --- a/src/core/include/mp-units/bits/type_list.h +++ b/src/core/include/mp-units/bits/type_list.h @@ -40,10 +40,10 @@ MP_UNITS_DIAGNOSTIC_IGNORE_EXPR_ALWAYS_TF namespace mp_units::detail { template -inline constexpr bool is_type_list = false; +constexpr bool is_type_list = false; template typename T, typename... Types> -inline constexpr bool is_type_list> = true; +constexpr bool is_type_list> = true; template concept TypeList = is_type_list; @@ -56,7 +56,7 @@ template typename List, typename... Types> struct type_list_size_impl> : std::integral_constant {}; template -inline constexpr std::size_t type_list_size = type_list_size_impl::value; +constexpr std::size_t type_list_size = type_list_size_impl::value; // map template typename To> diff --git a/src/core/include/mp-units/compat_macros.h b/src/core/include/mp-units/compat_macros.h index 4add3e12..f221bbbf 100644 --- a/src/core/include/mp-units/compat_macros.h +++ b/src/core/include/mp-units/compat_macros.h @@ -28,14 +28,14 @@ #if MP_UNITS_API_NO_CRTP -#define QUANTITY_SPEC(name, ...) \ - inline constexpr struct name final : ::mp_units::quantity_spec<__VA_ARGS__> { \ +#define QUANTITY_SPEC(name, ...) \ + constexpr struct name final : ::mp_units::quantity_spec<__VA_ARGS__> { \ } name #else -#define QUANTITY_SPEC(name, ...) \ - inline constexpr struct name final : ::mp_units::quantity_spec { \ +#define QUANTITY_SPEC(name, ...) \ + constexpr struct name final : ::mp_units::quantity_spec { \ } name #endif diff --git a/src/core/include/mp-units/ext/type_traits.h b/src/core/include/mp-units/ext/type_traits.h index 62e39f09..11b2b97b 100644 --- a/src/core/include/mp-units/ext/type_traits.h +++ b/src/core/include/mp-units/ext/type_traits.h @@ -60,26 +60,26 @@ using conditional = MP_UNITS_TYPENAME detail::conditional_impl::template type // is_same template -inline constexpr bool is_same_v = false; +constexpr bool is_same_v = false; template -inline constexpr bool is_same_v = true; +constexpr bool is_same_v = true; template using is_same = std::bool_constant>; // is_specialization_of template typename Type> -inline constexpr bool is_specialization_of = false; +constexpr bool is_specialization_of = false; template typename Type> -inline constexpr bool is_specialization_of, Type> = true; +constexpr bool is_specialization_of, Type> = true; template typename Type> -inline constexpr bool is_specialization_of_v = false; +constexpr bool is_specialization_of_v = false; template typename Type> -inline constexpr bool is_specialization_of_v, Type> = true; +constexpr bool is_specialization_of_v, Type> = true; MP_UNITS_EXPORT_END @@ -92,8 +92,7 @@ void to_base_specialization_of(const volatile Type*); } // namespace detail template typename Type> -inline constexpr bool is_derived_from_specialization_of = - requires(T* t) { detail::to_base_specialization_of(t); }; +constexpr bool is_derived_from_specialization_of = requires(T* t) { detail::to_base_specialization_of(t); }; namespace detail { diff --git a/src/core/include/mp-units/framework/construction_helpers.h b/src/core/include/mp-units/framework/construction_helpers.h index 6e20ebcc..3ad048d8 100644 --- a/src/core/include/mp-units/framework/construction_helpers.h +++ b/src/core/include/mp-units/framework/construction_helpers.h @@ -61,10 +61,10 @@ struct absolute_ { MP_UNITS_EXPORT_BEGIN template -inline constexpr delta_ delta{}; +constexpr delta_ delta{}; template -inline constexpr absolute_ absolute{}; +constexpr absolute_ absolute{}; MP_UNITS_EXPORT_END diff --git a/src/core/include/mp-units/framework/customization_points.h b/src/core/include/mp-units/framework/customization_points.h index 15fbf807..8d7add3f 100644 --- a/src/core/include/mp-units/framework/customization_points.h +++ b/src/core/include/mp-units/framework/customization_points.h @@ -50,11 +50,11 @@ MP_UNITS_EXPORT_BEGIN * @tparam Rep a representation type for which a type trait is defined */ template -inline constexpr bool treat_as_floating_point = std::is_floating_point_v; +constexpr bool treat_as_floating_point = std::is_floating_point_v; template requires requires { typename wrapped_type_t; } -inline constexpr bool treat_as_floating_point = treat_as_floating_point>; +constexpr bool treat_as_floating_point = treat_as_floating_point>; /** * @brief Specifies a type to have a scalar character @@ -62,7 +62,7 @@ inline constexpr bool treat_as_floating_point = treat_as_floating_point -inline constexpr bool is_scalar = std::is_floating_point_v || (std::is_integral_v && !is_same_v); +constexpr bool is_scalar = std::is_floating_point_v || (std::is_integral_v && !is_same_v); /** * @brief Specifies a type to have a vector character @@ -76,11 +76,11 @@ inline constexpr bool is_scalar = std::is_floating_point_v || (std::is_inte * @code{.cpp} * template * requires mp_units::is_scalar - * inline constexpr bool mp_units::is_vector = true; + * constexpr bool mp_units::is_vector = true; * @endcode */ template -inline constexpr bool is_vector = false; +constexpr bool is_vector = false; /** * @brief Specifies a type to have a tensor character @@ -91,7 +91,7 @@ inline constexpr bool is_vector = false; * Similarly to `is_vector` a partial specialization is needed in such cases. */ template -inline constexpr bool is_tensor = false; +constexpr bool is_tensor = false; /** * @brief A type trait that defines zero, one, min, and max for a representation type diff --git a/src/core/include/mp-units/framework/dimension.h b/src/core/include/mp-units/framework/dimension.h index 6b2cb360..71b63036 100644 --- a/src/core/include/mp-units/framework/dimension.h +++ b/src/core/include/mp-units/framework/dimension.h @@ -115,9 +115,9 @@ struct dimension_interface { * For example: * * @code{.cpp} - * inline constexpr struct dim_length final : base_dimension<"L"> {} dim_length; - * inline constexpr struct dim_time final : base_dimension<"T"> {} dim_time; - * inline constexpr struct dim_mass final : base_dimension<"M"> {} dim_mass; + * constexpr struct dim_length final : base_dimension<"L"> {} dim_length; + * constexpr struct dim_time final : base_dimension<"T"> {} dim_time; + * constexpr struct dim_mass final : base_dimension<"M"> {} dim_mass; * @endcode * * @note A common convention in this library is to assign the same name for a type and an object of this type. @@ -184,9 +184,7 @@ struct derived_dimension final : detail::dimension_interface, detail::derived_di * dimensions are zero. It is a dimension of a quantity of dimension one also known as * "dimensionless". */ -MP_UNITS_EXPORT inline constexpr struct dimension_one final : - detail::dimension_interface, - detail::derived_dimension_impl<> { +MP_UNITS_EXPORT constexpr struct dimension_one final : detail::dimension_interface, detail::derived_dimension_impl<> { } dimension_one; namespace detail { diff --git a/src/core/include/mp-units/framework/dimension_concepts.h b/src/core/include/mp-units/framework/dimension_concepts.h index 7517ea7f..9bf7b3b1 100644 --- a/src/core/include/mp-units/framework/dimension_concepts.h +++ b/src/core/include/mp-units/framework/dimension_concepts.h @@ -53,7 +53,7 @@ template void to_base_specialization_of_base_dimension(const volatile base_dimension*); template -inline constexpr bool is_derived_from_specialization_of_base_dimension = +constexpr bool is_derived_from_specialization_of_base_dimension = requires(T* t) { to_base_specialization_of_base_dimension(t); }; /** @@ -68,16 +68,16 @@ template struct is_dimension_one : std::false_type {}; template -inline constexpr bool is_power_of_dim = requires { +constexpr bool is_power_of_dim = requires { requires is_specialization_of_power && (BaseDimension || is_dimension_one::value); }; template -inline constexpr bool is_per_of_dims = false; +constexpr bool is_per_of_dims = false; template -inline constexpr bool is_per_of_dims> = +constexpr bool is_per_of_dims> = (... && (BaseDimension || is_dimension_one::value || is_power_of_dim)); template diff --git a/src/core/include/mp-units/framework/expression_template.h b/src/core/include/mp-units/framework/expression_template.h index 72a2db0e..51522f58 100644 --- a/src/core/include/mp-units/framework/expression_template.h +++ b/src/core/include/mp-units/framework/expression_template.h @@ -57,37 +57,37 @@ struct per {}; namespace detail { template -inline constexpr bool is_specialization_of_per = false; +constexpr bool is_specialization_of_per = false; template -inline constexpr bool is_specialization_of_per> = true; +constexpr bool is_specialization_of_per> = true; template -inline constexpr bool valid_ratio = true; +constexpr bool valid_ratio = true; template -inline constexpr bool valid_ratio<0, Den...> = false; +constexpr bool valid_ratio<0, Den...> = false; template -inline constexpr bool valid_ratio = false; +constexpr bool valid_ratio = false; template<> -inline constexpr bool valid_ratio<0, 0> = false; +constexpr bool valid_ratio<0, 0> = false; template -inline constexpr bool positive_ratio = gt_zero; +constexpr bool positive_ratio = gt_zero; template -inline constexpr bool positive_ratio = gt_zero; +constexpr bool positive_ratio = gt_zero; template -inline constexpr bool ratio_one = false; +constexpr bool ratio_one = false; template<> -inline constexpr bool ratio_one<1> = true; +constexpr bool ratio_one<1> = true; template -inline constexpr bool ratio_one = true; +constexpr bool ratio_one = true; } // namespace detail @@ -127,10 +127,10 @@ using expr_type = MP_UNITS_TYPENAME detail::expr_type_impl::type; namespace detail { template -inline constexpr bool is_specialization_of_power = false; +constexpr bool is_specialization_of_power = false; template -inline constexpr bool is_specialization_of_power> = true; +constexpr bool is_specialization_of_power> = true; template consteval auto power_or_T_impl() @@ -509,10 +509,10 @@ concept expr_type_projectable = (requires { typename Proj; } || (is_specialization_of_power && requires { typename Proj; })); template typename Proj> -inline constexpr bool expr_projectable_impl = false; +constexpr bool expr_projectable_impl = false; template typename Proj> -inline constexpr bool expr_projectable_impl, Proj> = (... && expr_type_projectable); +constexpr bool expr_projectable_impl, Proj> = (... && expr_type_projectable); template typename Proj> concept expr_projectable = requires { diff --git a/src/core/include/mp-units/framework/magnitude.h b/src/core/include/mp-units/framework/magnitude.h index d1632528..84312fd3 100644 --- a/src/core/include/mp-units/framework/magnitude.h +++ b/src/core/include/mp-units/framework/magnitude.h @@ -59,10 +59,10 @@ using factorizer = wheel_factorizer<4>; namespace detail { template -inline constexpr bool is_magnitude = false; +constexpr bool is_magnitude = false; template -inline constexpr bool is_specialization_of_magnitude = false; +constexpr bool is_specialization_of_magnitude = false; } // namespace detail @@ -87,7 +87,7 @@ concept Magnitude = detail::is_magnitude; // void to_base_specialization_of_constant(const volatile constant*); // template -// inline constexpr bool is_derived_from_specialization_of_constant = +// constexpr bool is_derived_from_specialization_of_constant = // requires(T * t) { to_base_specialization_of_constant(t); }; // } // namespace detail @@ -142,7 +142,7 @@ concept Magnitude = detail::is_magnitude; namespace detail { template -inline constexpr bool is_named_magnitude = Magnitude && !detail::is_specialization_of_magnitude; +constexpr bool is_named_magnitude = Magnitude && !detail::is_specialization_of_magnitude; } @@ -178,10 +178,10 @@ struct power_v { namespace detail { template -inline constexpr bool is_specialization_of_power_v = false; +constexpr bool is_specialization_of_power_v = false; template -inline constexpr bool is_specialization_of_power_v> = true; +constexpr bool is_specialization_of_power_v> = true; } // namespace detail @@ -572,13 +572,13 @@ namespace detail { // } // template -// inline constexpr bool all_elements_valid = (is_valid_element(Elements) && ...); +// constexpr bool all_elements_valid = (is_valid_element(Elements) && ...); // template -// inline constexpr bool all_elements_in_order = strictly_increasing(get_base_value(Elements)...); +// constexpr bool all_elements_in_order = strictly_increasing(get_base_value(Elements)...); // template -// inline constexpr bool is_element_pack_valid = all_elements_valid && all_elements_in_order; +// constexpr bool is_element_pack_valid = all_elements_valid && all_elements_in_order; [[nodiscard]] consteval bool is_rational(MagnitudeSpec auto element) { @@ -707,15 +707,14 @@ template void to_base_specialization_of_magnitude(const volatile magnitude*); template -inline constexpr bool is_derived_from_specialization_of_magnitude = - requires(T* t) { to_base_specialization_of_magnitude(t); }; +constexpr bool is_derived_from_specialization_of_magnitude = requires(T* t) { to_base_specialization_of_magnitude(t); }; template requires is_derived_from_specialization_of_magnitude -inline constexpr bool is_magnitude = true; +constexpr bool is_magnitude = true; template -inline constexpr bool is_specialization_of_magnitude> = true; +constexpr bool is_specialization_of_magnitude> = true; } // namespace detail @@ -726,12 +725,12 @@ MP_UNITS_EXPORT_BEGIN */ #if MP_UNITS_COMP_CLANG -inline constexpr struct mag_pi : magnitude}> { +constexpr struct mag_pi : magnitude}> { } mag_pi; #else -inline constexpr struct mag_pi : magnitude> { +constexpr struct mag_pi : magnitude> { } mag_pi; #endif @@ -882,7 +881,7 @@ using common_magnitude_type = decltype(common_magnitude_type_impl(M)); // // WARNING: The program behaviour will be undefined if you provide a wrong answer, so check your math! MP_UNITS_EXPORT template -inline constexpr std::optional known_first_factor = std::nullopt; +constexpr std::optional known_first_factor = std::nullopt; namespace detail { @@ -915,7 +914,7 @@ struct prime_factorization<1> { }; template -inline constexpr auto prime_factorization_v = prime_factorization::value; +constexpr auto prime_factorization_v = prime_factorization::value; } // namespace detail @@ -927,18 +926,18 @@ inline constexpr auto prime_factorization_v = prime_factorization::value; */ MP_UNITS_EXPORT template requires detail::gt_zero -inline constexpr Magnitude auto mag = detail::prime_factorization_v; +constexpr Magnitude auto mag = detail::prime_factorization_v; MP_UNITS_EXPORT template requires detail::gt_zero -inline constexpr Magnitude auto mag_ratio = detail::prime_factorization_v / detail::prime_factorization_v; +constexpr Magnitude auto mag_ratio = detail::prime_factorization_v / detail::prime_factorization_v; /** * @brief Create a Magnitude which is some rational number raised to a rational power. */ MP_UNITS_EXPORT template requires detail::gt_zero -inline constexpr Magnitude auto mag_power = pow(mag); +constexpr Magnitude auto mag_power = pow(mag); namespace detail { @@ -960,7 +959,7 @@ template return integer_part((detail::abs(power_of_2) < detail::abs(power_of_5)) ? power_of_2 : power_of_5); } -inline constexpr symbol_text base_multiplier(u8"× 10", "x 10"); +constexpr symbol_text base_multiplier(u8"× 10", "x 10"); template [[nodiscard]] consteval auto magnitude_text() diff --git a/src/core/include/mp-units/framework/quantity_concepts.h b/src/core/include/mp-units/framework/quantity_concepts.h index 37929f19..66b03efe 100644 --- a/src/core/include/mp-units/framework/quantity_concepts.h +++ b/src/core/include/mp-units/framework/quantity_concepts.h @@ -40,8 +40,7 @@ template void to_base_specialization_of_quantity(const volatile quantity*); template -inline constexpr bool is_derived_from_specialization_of_quantity = - requires(T* t) { to_base_specialization_of_quantity(t); }; +constexpr bool is_derived_from_specialization_of_quantity = requires(T* t) { to_base_specialization_of_quantity(t); }; } // namespace detail diff --git a/src/core/include/mp-units/framework/quantity_point.h b/src/core/include/mp-units/framework/quantity_point.h index aa4763d6..a3d07fed 100644 --- a/src/core/include/mp-units/framework/quantity_point.h +++ b/src/core/include/mp-units/framework/quantity_point.h @@ -43,7 +43,7 @@ namespace mp_units { namespace detail { template -inline constexpr bool is_specialization_of_zeroth_point_origin = false; +constexpr bool is_specialization_of_zeroth_point_origin = false; template [[nodiscard]] consteval bool is_zeroth_point_origin(PO) @@ -130,12 +130,12 @@ template struct zeroth_point_origin_ final : absolute_point_origin {}; MP_UNITS_EXPORT template -inline constexpr zeroth_point_origin_ zeroth_point_origin; +constexpr zeroth_point_origin_ zeroth_point_origin; namespace detail { template -inline constexpr bool is_specialization_of_zeroth_point_origin> = true; +constexpr bool is_specialization_of_zeroth_point_origin> = true; } // namespace detail diff --git a/src/core/include/mp-units/framework/quantity_point_concepts.h b/src/core/include/mp-units/framework/quantity_point_concepts.h index a262ea7d..8176f6a7 100644 --- a/src/core/include/mp-units/framework/quantity_point_concepts.h +++ b/src/core/include/mp-units/framework/quantity_point_concepts.h @@ -38,13 +38,13 @@ struct absolute_point_origin; namespace detail { template -inline constexpr bool is_quantity_point = false; +constexpr bool is_quantity_point = false; template void to_base_specialization_of_absolute_point_origin(const volatile absolute_point_origin*); template -inline constexpr bool is_derived_from_specialization_of_absolute_point_origin = +constexpr bool is_derived_from_specialization_of_absolute_point_origin = requires(T* t) { to_base_specialization_of_absolute_point_origin(t); }; } // namespace detail @@ -66,7 +66,7 @@ template void to_base_specialization_of_relative_point_origin(const volatile relative_point_origin*); template -inline constexpr bool is_derived_from_specialization_of_relative_point_origin = +constexpr bool is_derived_from_specialization_of_relative_point_origin = requires(T* t) { to_base_specialization_of_relative_point_origin(t); }; struct point_origin_interface; @@ -99,12 +99,12 @@ template void to_base_specialization_of_quantity_point(const volatile quantity_point*); template -inline constexpr bool is_derived_from_specialization_of_quantity_point = +constexpr bool is_derived_from_specialization_of_quantity_point = requires(T* t) { to_base_specialization_of_quantity_point(t); }; template requires is_derived_from_specialization_of_quantity_point -inline constexpr bool is_quantity_point = true; +constexpr bool is_quantity_point = true; template [[nodiscard]] consteval bool same_absolute_point_origins(PO1 po1, PO2 po2) diff --git a/src/core/include/mp-units/framework/quantity_spec.h b/src/core/include/mp-units/framework/quantity_spec.h index 88eec204..a58a73e1 100644 --- a/src/core/include/mp-units/framework/quantity_spec.h +++ b/src/core/include/mp-units/framework/quantity_spec.h @@ -189,7 +189,7 @@ struct quantity_spec_interface : quantity_spec_interface_base { MP_UNITS_EXPORT_BEGIN -inline constexpr struct is_kind { +constexpr struct is_kind { } is_kind; /** @@ -235,13 +235,13 @@ MP_UNITS_EXPORT_END * For example: * * @code{.cpp} - * inline constexpr struct dim_length final : base_dimension<"L"> {} dim_length; - * inline constexpr struct dim_mass final : base_dimension<"M"> {} dim_mass; - * inline constexpr struct dim_time final : base_dimension<"T"> {} dim_time; + * constexpr struct dim_length final : base_dimension<"L"> {} dim_length; + * constexpr struct dim_mass final : base_dimension<"M"> {} dim_mass; + * constexpr struct dim_time final : base_dimension<"T"> {} dim_time; * - * inline constexpr struct length final : quantity_spec {} length; - * inline constexpr struct mass final : quantity_spec {} mass; - * inline constexpr struct time final : quantity_spec {} time; + * constexpr struct length final : quantity_spec {} length; + * constexpr struct mass final : quantity_spec {} mass; + * constexpr struct time final : quantity_spec {} time; * @endcode * * @note A common convention in this library is to assign the same name for a type and an object of this type. @@ -280,12 +280,12 @@ struct quantity_spec : detail::quantity_spec_interface * For example: * * @code{.cpp} - * inline constexpr struct area final : quantity_spec(length)> {} area; - * inline constexpr struct volume final : quantity_spec(length)> {} volume; - * inline constexpr struct velocity final : quantity_spec {} velocity; - * inline constexpr struct speed final : quantity_spec {} speed; - * inline constexpr struct force final : quantity_spec {} force; - * inline constexpr struct power final : quantity_spec {} power; + * constexpr struct area final : quantity_spec(length)> {} area; + * constexpr struct volume final : quantity_spec(length)> {} volume; + * constexpr struct velocity final : quantity_spec {} velocity; + * constexpr struct speed final : quantity_spec {} speed; + * constexpr struct force final : quantity_spec {} force; + * constexpr struct power final : quantity_spec {} power; * @endcode * * @note A common convention in this library is to assign the same name for a type and an object of this type. @@ -335,10 +335,10 @@ struct propagate_equation { * For example: * * @code{.cpp} - * inline constexpr struct width final : quantity_spec {} width; - * inline constexpr struct height final : quantity_spec {} height; - * inline constexpr struct diameter final : quantity_spec {} diameter; - * inline constexpr struct position_vector final : quantity_spec {} position_vector; + * constexpr struct width final : quantity_spec {} width; + * constexpr struct height final : quantity_spec {} height; + * constexpr struct diameter final : quantity_spec {} diameter; + * constexpr struct position_vector final : quantity_spec {} position_vector; * @endcode * * @note A common convention in this library is to assign the same name for a type and an object of this type. @@ -396,10 +396,10 @@ struct quantity_spec : detail::propagate_equation, detail * For example: * * @code{.cpp} - * inline constexpr struct angular_measure final : quantity_spec {} angular_measure; - * inline constexpr struct velocity final : quantity_spec {} velocity; - * inline constexpr struct weight final : quantity_spec {} weight; - * inline constexpr struct kinetic_energy final : quantity_spec(speed)> {} kinetic_energy; + * constexpr struct angular_measure final : quantity_spec {} angular_measure; + * constexpr struct velocity final : quantity_spec {} velocity; + * constexpr struct weight final : quantity_spec {} weight; + * constexpr struct kinetic_energy final : quantity_spec(speed)> {} kinetic_energy; * @endcode * * @note A common convention in this library is to assign the same name for a type and an object of this type. @@ -556,7 +556,7 @@ struct kind_of_ final : quantity_spec, Q{}>::_base_type_ { MP_UNITS_EXPORT template requires detail::SameQuantitySpec -inline constexpr kind_of_ kind_of; +constexpr kind_of_ kind_of; namespace detail { diff --git a/src/core/include/mp-units/framework/quantity_spec_concepts.h b/src/core/include/mp-units/framework/quantity_spec_concepts.h index 9eac9f2d..296e7e9d 100644 --- a/src/core/include/mp-units/framework/quantity_spec_concepts.h +++ b/src/core/include/mp-units/framework/quantity_spec_concepts.h @@ -53,10 +53,10 @@ struct kind_of_; namespace detail { template -inline constexpr bool is_specialization_of_kind_of = false; +constexpr bool is_specialization_of_kind_of = false; template -inline constexpr bool is_specialization_of_kind_of> = true; +constexpr bool is_specialization_of_kind_of> = true; template concept QuantityKindSpec = is_specialization_of_kind_of; @@ -70,7 +70,7 @@ void to_base_specialization_of_quantity_spec(const volatile quantity_spec -inline constexpr bool is_derived_from_specialization_of_quantity_spec = +constexpr bool is_derived_from_specialization_of_quantity_spec = requires(T* t) { to_base_specialization_of_quantity_spec(t); }; /** @@ -86,16 +86,16 @@ template struct is_dimensionless : std::false_type {}; template -inline constexpr bool is_power_of_quantity_spec = requires { +constexpr bool is_power_of_quantity_spec = requires { requires is_specialization_of_power && (NamedQuantitySpec || is_dimensionless::value); }; template -inline constexpr bool is_per_of_quantity_specs = false; +constexpr bool is_per_of_quantity_specs = false; template -inline constexpr bool is_per_of_quantity_specs> = +constexpr bool is_per_of_quantity_specs> = (... && (NamedQuantitySpec || is_dimensionless::value || is_power_of_quantity_spec)); template diff --git a/src/core/include/mp-units/framework/system_reference.h b/src/core/include/mp-units/framework/system_reference.h index 3df21be2..6bac8d79 100644 --- a/src/core/include/mp-units/framework/system_reference.h +++ b/src/core/include/mp-units/framework/system_reference.h @@ -45,15 +45,15 @@ namespace mp_units { * @code{.cpp} * // hypothetical natural system of units for c=1 * - * inline constexpr struct second final : named_unit<"s"> {} second; - * inline constexpr struct minute final : named_unit<"min", mag<60> * second> {} minute; - * inline constexpr struct gram final : named_unit<"g"> {} gram; - * inline constexpr auto kilogram = si::kilo; + * constexpr struct second final : named_unit<"s"> {} second; + * constexpr struct minute final : named_unit<"min", mag<60> * second> {} minute; + * constexpr struct gram final : named_unit<"g"> {} gram; + * constexpr auto kilogram = si::kilo; * - * inline constexpr struct time : system_reference {} time; - * inline constexpr struct length : system_reference {} length; - * inline constexpr struct speed : system_reference {} speed; - * inline constexpr struct force : system_reference {} force; + * constexpr struct time : system_reference {} time; + * constexpr struct length : system_reference {} length; + * constexpr struct speed : system_reference {} speed; + * constexpr struct force : system_reference {} force; * @endcode * * @tparam Q quantity for which a unit is being assigned diff --git a/src/core/include/mp-units/framework/unit.h b/src/core/include/mp-units/framework/unit.h index 411f3256..1e564107 100644 --- a/src/core/include/mp-units/framework/unit.h +++ b/src/core/include/mp-units/framework/unit.h @@ -64,7 +64,7 @@ template struct scaled_unit_impl; template -inline constexpr bool is_specialization_of_scaled_unit = false; +constexpr bool is_specialization_of_scaled_unit = false; template struct derived_unit_impl; @@ -241,7 +241,7 @@ struct scaled_unit final : detail::scaled_unit_impl {}; namespace detail { template -inline constexpr bool is_specialization_of_scaled_unit> = true; +constexpr bool is_specialization_of_scaled_unit> = true; } // namespace detail @@ -256,12 +256,12 @@ inline constexpr bool is_specialization_of_scaled_unit> = true * For example: * * @code{.cpp} - * inline constexpr struct second final : named_unit<"s", kind_of B; + * constexpr struct A : absolute_point_origin A; + * constexpr struct B : relative_point_origin B; * * using ToQP = quantity_point; * auto qp = value_cast(quantity_point{1.23 * m}); diff --git a/src/systems/include/mp-units/systems/angular/units.h b/src/systems/include/mp-units/systems/angular/units.h index b8ebdfd9..75e5eaea 100644 --- a/src/systems/include/mp-units/systems/angular/units.h +++ b/src/systems/include/mp-units/systems/angular/units.h @@ -36,34 +36,34 @@ namespace mp_units { namespace angular { // clang-format off -inline constexpr struct dim_angle final : base_dimension<"A"> {} dim_angle; +constexpr struct dim_angle final : base_dimension<"A"> {} dim_angle; QUANTITY_SPEC(angle, dim_angle); QUANTITY_SPEC(solid_angle, pow<2>(angle)); -inline constexpr struct radian final : named_unit<"rad", kind_of> {} radian; -inline constexpr struct revolution final : named_unit<"rev", mag<2> * mag_pi * radian> {} revolution; -inline constexpr struct degree final : named_unit * revolution> {} degree; -inline constexpr struct gradian final : named_unit * revolution> {} gradian; -inline constexpr struct steradian final : named_unit<"sr", square(radian)> {} steradian; +constexpr struct radian final : named_unit<"rad", kind_of> {} radian; +constexpr struct revolution final : named_unit<"rev", mag<2> * mag_pi * radian> {} revolution; +constexpr struct degree final : named_unit * revolution> {} degree; +constexpr struct gradian final : named_unit * revolution> {} gradian; +constexpr struct steradian final : named_unit<"sr", square(radian)> {} steradian; // clang-format on namespace unit_symbols { -inline constexpr auto rad = radian; -inline constexpr auto rev = revolution; -inline constexpr auto deg = degree; -inline constexpr auto grad = gradian; -inline constexpr auto sr = steradian; -inline constexpr auto rad2 = square(radian); -inline constexpr auto deg2 = square(degree); +constexpr auto rad = radian; +constexpr auto rev = revolution; +constexpr auto deg = degree; +constexpr auto grad = gradian; +constexpr auto sr = steradian; +constexpr auto rad2 = square(radian); +constexpr auto deg2 = square(degree); } // namespace unit_symbols } // namespace angular template<> -inline constexpr bool space_before_unit_symbol = false; +constexpr bool space_before_unit_symbol = false; template<> -inline constexpr bool space_before_unit_symbol = false; +constexpr bool space_before_unit_symbol = false; } // namespace mp_units diff --git a/src/systems/include/mp-units/systems/cgs.h b/src/systems/include/mp-units/systems/cgs.h index 9ae0d265..ad65a7fa 100644 --- a/src/systems/include/mp-units/systems/cgs.h +++ b/src/systems/include/mp-units/systems/cgs.h @@ -35,35 +35,35 @@ MP_UNITS_EXPORT namespace mp_units::cgs { // clang-format off -inline constexpr auto centimetre = si::centi; -inline constexpr auto gram = si::gram; -inline constexpr auto second = si::second; -inline constexpr struct gal final : named_unit<"Gal", centimetre / square(second)> {} gal; -inline constexpr struct dyne final : named_unit<"dyn", gram * centimetre / square(second)> {} dyne; -inline constexpr struct erg final : named_unit<"erg", dyne * centimetre> {} erg; -inline constexpr struct barye final : named_unit<"Ba", gram / (centimetre * square(second))> {} barye; -inline constexpr struct poise final : named_unit<"P", gram / (centimetre * second)> {} poise; -inline constexpr struct stokes final : named_unit<"St", square(centimetre) / second> {} stokes; -inline constexpr struct kayser final : named_unit<"K", one / centimetre> {} kayser; +constexpr auto centimetre = si::centi; +constexpr auto gram = si::gram; +constexpr auto second = si::second; +constexpr struct gal final : named_unit<"Gal", centimetre / square(second)> {} gal; +constexpr struct dyne final : named_unit<"dyn", gram * centimetre / square(second)> {} dyne; +constexpr struct erg final : named_unit<"erg", dyne * centimetre> {} erg; +constexpr struct barye final : named_unit<"Ba", gram / (centimetre * square(second))> {} barye; +constexpr struct poise final : named_unit<"P", gram / (centimetre * second)> {} poise; +constexpr struct stokes final : named_unit<"St", square(centimetre) / second> {} stokes; +constexpr struct kayser final : named_unit<"K", one / centimetre> {} kayser; // clang-format on namespace unit_symbols { -inline constexpr auto cm = centimetre; -inline constexpr auto g = gram; -inline constexpr auto s = second; -inline constexpr auto Gal = gal; -inline constexpr auto dyn = dyne; -inline constexpr auto Ba = barye; -inline constexpr auto P = poise; -inline constexpr auto St = stokes; -inline constexpr auto K = kayser; +constexpr auto cm = centimetre; +constexpr auto g = gram; +constexpr auto s = second; +constexpr auto Gal = gal; +constexpr auto dyn = dyne; +constexpr auto Ba = barye; +constexpr auto P = poise; +constexpr auto St = stokes; +constexpr auto K = kayser; // commonly used squared and cubic units -inline constexpr auto cm2 = square(centimetre); -inline constexpr auto cm3 = cubic(centimetre); -inline constexpr auto s2 = square(second); -inline constexpr auto s3 = cubic(second); +constexpr auto cm2 = square(centimetre); +constexpr auto cm3 = cubic(centimetre); +constexpr auto s2 = square(second); +constexpr auto s3 = cubic(second); } // namespace unit_symbols diff --git a/src/systems/include/mp-units/systems/hep.h b/src/systems/include/mp-units/systems/hep.h index 77f6a516..8ea81cc3 100644 --- a/src/systems/include/mp-units/systems/hep.h +++ b/src/systems/include/mp-units/systems/hep.h @@ -36,7 +36,7 @@ MP_UNITS_EXPORT namespace mp_units { template<> -inline constexpr std::optional known_first_factor<334'524'384'739> = 334'524'384'739; +constexpr std::optional known_first_factor<334'524'384'739> = 334'524'384'739; namespace hep { @@ -49,64 +49,64 @@ using si::electronvolt; // effective cross-sectional area according to EU council directive 80/181/EEC // https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:01980L0181-20090527#page=10 // https://www.fedlex.admin.ch/eli/cc/1994/3109_3109_3109/de -inline constexpr struct barn final : named_unit<"b", mag_power<10, -28> * square(si::metre)> {} barn; +constexpr struct barn final : named_unit<"b", mag_power<10, -28> * square(si::metre)> {} barn; // mass -inline constexpr struct electron_mass final : named_unit<"m_e", mag_ratio<9'109'383'701'528, 1'000'000'000'000> * mag_power<10, -31> * si::kilogram> {} electron_mass; -inline constexpr struct proton_mass final : named_unit<"m_p", mag_ratio<1'672'621'923'695, 1'000'000'000'000> * mag_power<10, -27> * si::kilogram> {} proton_mass; -inline constexpr struct neutron_mass final : named_unit<"m_n", mag_ratio<1'674'927'498'049, 1'000'000'000'000> * mag_power<10, -27> * si::kilogram> {} neutron_mass; +constexpr struct electron_mass final : named_unit<"m_e", mag_ratio<9'109'383'701'528, 1'000'000'000'000> * mag_power<10, -31> * si::kilogram> {} electron_mass; +constexpr struct proton_mass final : named_unit<"m_p", mag_ratio<1'672'621'923'695, 1'000'000'000'000> * mag_power<10, -27> * si::kilogram> {} proton_mass; +constexpr struct neutron_mass final : named_unit<"m_n", mag_ratio<1'674'927'498'049, 1'000'000'000'000> * mag_power<10, -27> * si::kilogram> {} neutron_mass; // speed -inline constexpr auto speed_of_light = si::si2019::speed_of_light_in_vacuum; +constexpr auto speed_of_light = si::si2019::speed_of_light_in_vacuum; // clang-format on namespace unit_symbols { using si::unit_symbols::eV; -inline constexpr auto qeV = si::quecto; -inline constexpr auto reV = si::ronto; -inline constexpr auto yeV = si::yocto; -inline constexpr auto zeV = si::zepto; -inline constexpr auto aeV = si::atto; -inline constexpr auto feV = si::femto; -inline constexpr auto peV = si::pico; -inline constexpr auto neV = si::nano; -inline constexpr auto ueV = si::micro; -inline constexpr auto meV = si::milli; -inline constexpr auto ceV = si::centi; -inline constexpr auto deV = si::deci; -inline constexpr auto daeV = si::deca; -inline constexpr auto heV = si::hecto; -inline constexpr auto keV = si::kilo; -inline constexpr auto MeV = si::mega; -inline constexpr auto GeV = si::giga; -inline constexpr auto TeV = si::tera; -inline constexpr auto PeV = si::peta; -inline constexpr auto EeV = si::exa; -inline constexpr auto ZeV = si::zetta; -inline constexpr auto YeV = si::yotta; -inline constexpr auto ReV = si::ronna; -inline constexpr auto QeV = si::quetta; +constexpr auto qeV = si::quecto; +constexpr auto reV = si::ronto; +constexpr auto yeV = si::yocto; +constexpr auto zeV = si::zepto; +constexpr auto aeV = si::atto; +constexpr auto feV = si::femto; +constexpr auto peV = si::pico; +constexpr auto neV = si::nano; +constexpr auto ueV = si::micro; +constexpr auto meV = si::milli; +constexpr auto ceV = si::centi; +constexpr auto deV = si::deci; +constexpr auto daeV = si::deca; +constexpr auto heV = si::hecto; +constexpr auto keV = si::kilo; +constexpr auto MeV = si::mega; +constexpr auto GeV = si::giga; +constexpr auto TeV = si::tera; +constexpr auto PeV = si::peta; +constexpr auto EeV = si::exa; +constexpr auto ZeV = si::zetta; +constexpr auto YeV = si::yotta; +constexpr auto ReV = si::ronna; +constexpr auto QeV = si::quetta; -inline constexpr auto qb = si::quecto; -inline constexpr auto rb = si::ronto; -inline constexpr auto yb = si::yocto; -inline constexpr auto zb = si::zepto; -inline constexpr auto ab = si::atto; -inline constexpr auto fb = si::femto; -inline constexpr auto pb = si::pico; -inline constexpr auto nb = si::nano; -inline constexpr auto ub = si::micro; -inline constexpr auto mb = si::milli; -inline constexpr auto b = barn; +constexpr auto qb = si::quecto; +constexpr auto rb = si::ronto; +constexpr auto yb = si::yocto; +constexpr auto zb = si::zepto; +constexpr auto ab = si::atto; +constexpr auto fb = si::femto; +constexpr auto pb = si::pico; +constexpr auto nb = si::nano; +constexpr auto ub = si::micro; +constexpr auto mb = si::milli; +constexpr auto b = barn; -inline constexpr auto m_e = electron_mass; -inline constexpr auto m_p = proton_mass; -inline constexpr auto m_n = neutron_mass; +constexpr auto m_e = electron_mass; +constexpr auto m_p = proton_mass; +constexpr auto m_n = neutron_mass; -inline constexpr auto c = speed_of_light; -inline constexpr auto c2 = square(speed_of_light); +constexpr auto c = speed_of_light; +constexpr auto c2 = square(speed_of_light); } // namespace unit_symbols } // namespace hep diff --git a/src/systems/include/mp-units/systems/iau.h b/src/systems/include/mp-units/systems/iau.h index c81777aa..d08c0c73 100644 --- a/src/systems/include/mp-units/systems/iau.h +++ b/src/systems/include/mp-units/systems/iau.h @@ -39,65 +39,65 @@ namespace mp_units::iau { // clang-format off // time -inline constexpr struct day final : named_unit<"D", si::day> {} day; -inline constexpr struct Julian_year final : named_unit<"a", mag_ratio<365'25, 100> * day> {} Julian_year; +constexpr struct day final : named_unit<"D", si::day> {} day; +constexpr struct Julian_year final : named_unit<"a", mag_ratio<365'25, 100> * day> {} Julian_year; // mass // https://en.wikipedia.org/wiki/Solar_mass // TODO What is the official mass of sun (every source in the Internet provides a different value) -inline constexpr struct solar_mass final : named_unit * mag_power<10, 30> * si::kilogram> {} solar_mass; -inline constexpr struct Jupiter_mass final : named_unit<"M_JUP", mag_ratio<1'898, 1'000> * mag_power<10, 27> * si::kilogram> {} Jupiter_mass; -inline constexpr struct Earth_mass final : named_unit<"M_EARTH", mag_ratio<59'742, 10'000> * mag_power<10, 24> * si::kilogram> {} Earth_mass; +constexpr struct solar_mass final : named_unit * mag_power<10, 30> * si::kilogram> {} solar_mass; +constexpr struct Jupiter_mass final : named_unit<"M_JUP", mag_ratio<1'898, 1'000> * mag_power<10, 27> * si::kilogram> {} Jupiter_mass; +constexpr struct Earth_mass final : named_unit<"M_EARTH", mag_ratio<59'742, 10'000> * mag_power<10, 24> * si::kilogram> {} Earth_mass; // length -inline constexpr auto astronomical_unit = si::astronomical_unit; +constexpr auto astronomical_unit = si::astronomical_unit; // https://en.wikipedia.org/wiki/Lunar_distance_(astronomy) -inline constexpr struct lunar_distance final : named_unit<"LD", mag<384'399> * si::kilo> {} lunar_distance; +constexpr struct lunar_distance final : named_unit<"LD", mag<384'399> * si::kilo> {} lunar_distance; // https://en.wikipedia.org/wiki/Light-year -inline constexpr struct light_year final : named_unit<"ly", mag<9'460'730'472'580'800> * si::metre> {} light_year; +constexpr struct light_year final : named_unit<"ly", mag<9'460'730'472'580'800> * si::metre> {} light_year; // https://en.wikipedia.org/wiki/Parsec -inline constexpr struct parsec final : named_unit<"pc", astronomical_unit / (mag_ratio<1, 3600> * si::degree)> {} parsec; +constexpr struct parsec final : named_unit<"pc", astronomical_unit / (mag_ratio<1, 3600> * si::degree)> {} parsec; // https://en.wikipedia.org/wiki/Angstrom -inline constexpr struct angstrom final : named_unit * si::metre> {} angstrom; +constexpr struct angstrom final : named_unit * si::metre> {} angstrom; // selected constants // https://en.wikipedia.org/wiki/Astronomical_constant -inline constexpr struct gaussian_gravitational_constant final : +constexpr struct gaussian_gravitational_constant final : named_unit<"k", mag_ratio<1'720'209'895, 100'000'000'000> * pow<3, 2>(astronomical_unit) / pow<1,2>(solar_mass) / day> {} gaussian_gravitational_constant; -inline constexpr struct speed_of_light final : +constexpr struct speed_of_light final : named_unit {} speed_of_light; -inline constexpr struct constant_of_gravitation final : +constexpr struct constant_of_gravitation final : named_unit<"G", mag_ratio<667'430, 100'000> * mag_power<10, -11> * cubic(si::metre) / si::kilogram / square(si::second)> {} constant_of_gravitation; -inline constexpr struct hubble_constant final : +constexpr struct hubble_constant final : named_unit * si::kilo / si::second / si::mega> {} hubble_constant; // clang-format on namespace unit_symbols { -inline constexpr auto D = day; -inline constexpr auto a = Julian_year; +constexpr auto D = day; +constexpr auto a = Julian_year; -inline constexpr auto M_SUN = solar_mass; -inline constexpr auto M_JUP = Jupiter_mass; -inline constexpr auto M_EARTH = Earth_mass; +constexpr auto M_SUN = solar_mass; +constexpr auto M_JUP = Jupiter_mass; +constexpr auto M_EARTH = Earth_mass; -inline constexpr auto au = astronomical_unit; -inline constexpr auto LD = lunar_distance; -inline constexpr auto ly = light_year; -inline constexpr auto pc = parsec; -inline constexpr auto A = angstrom; +constexpr auto au = astronomical_unit; +constexpr auto LD = lunar_distance; +constexpr auto ly = light_year; +constexpr auto pc = parsec; +constexpr auto A = angstrom; -inline constexpr auto k = gaussian_gravitational_constant; -inline constexpr auto c_0 = speed_of_light; -inline constexpr auto G = constant_of_gravitation; -inline constexpr auto H_0 = hubble_constant; +constexpr auto k = gaussian_gravitational_constant; +constexpr auto c_0 = speed_of_light; +constexpr auto G = constant_of_gravitation; +constexpr auto H_0 = hubble_constant; } // namespace unit_symbols diff --git a/src/systems/include/mp-units/systems/iec80000/binary_prefixes.h b/src/systems/include/mp-units/systems/iec80000/binary_prefixes.h index 5eb39132..e09a218d 100644 --- a/src/systems/include/mp-units/systems/iec80000/binary_prefixes.h +++ b/src/systems/include/mp-units/systems/iec80000/binary_prefixes.h @@ -42,14 +42,14 @@ template struct yobi_ final : prefixed_unit<"Yi", mag_power<2, MP_UNITS_EXPORT_BEGIN -template inline constexpr kibi_ kibi; -template inline constexpr mebi_ mebi; -template inline constexpr gibi_ gibi; -template inline constexpr tebi_ tebi; -template inline constexpr pebi_ pebi; -template inline constexpr exbi_ exbi; -template inline constexpr zebi_ zebi; -template inline constexpr yobi_ yobi; +template constexpr kibi_ kibi; +template constexpr mebi_ mebi; +template constexpr gibi_ gibi; +template constexpr tebi_ tebi; +template constexpr pebi_ pebi; +template constexpr exbi_ exbi; +template constexpr zebi_ zebi; +template constexpr yobi_ yobi; // clang-format on MP_UNITS_EXPORT_END diff --git a/src/systems/include/mp-units/systems/iec80000/quantities.h b/src/systems/include/mp-units/systems/iec80000/quantities.h index f9b23547..f4717308 100644 --- a/src/systems/include/mp-units/systems/iec80000/quantities.h +++ b/src/systems/include/mp-units/systems/iec80000/quantities.h @@ -36,40 +36,40 @@ namespace mp_units::iec80000 { // dimensions of base quantities // clang-format off -inline constexpr struct dim_traffic_intensity final : base_dimension<"A"> {} dim_traffic_intensity; +constexpr struct dim_traffic_intensity final : base_dimension<"A"> {} dim_traffic_intensity; // clang-format on // quantities QUANTITY_SPEC(traffic_intensity, dim_traffic_intensity); QUANTITY_SPEC(traffic_offered_intensity, traffic_intensity); QUANTITY_SPEC(traffic_carried_intensity, traffic_intensity); -inline constexpr auto traffic_load = traffic_carried_intensity; +constexpr auto traffic_load = traffic_carried_intensity; QUANTITY_SPEC(mean_queue_length, dimensionless); QUANTITY_SPEC(loss_probability, dimensionless); QUANTITY_SPEC(waiting_probability, dimensionless); QUANTITY_SPEC(call_intensity, inverse(isq::duration)); -inline constexpr auto calling_rate = call_intensity; +constexpr auto calling_rate = call_intensity; QUANTITY_SPEC(completed_call_intensity, call_intensity); QUANTITY_SPEC(storage_capacity, dimensionless, is_kind); -inline constexpr auto storage_size = storage_capacity; +constexpr auto storage_size = storage_capacity; QUANTITY_SPEC(equivalent_binary_storage_capacity, storage_capacity); QUANTITY_SPEC(transfer_rate, storage_capacity / isq::duration); QUANTITY_SPEC(period_of_data_elements, isq::period, inverse(transfer_rate)); QUANTITY_SPEC(binary_digit_rate, transfer_rate); -inline constexpr auto bit_rate = binary_digit_rate; +constexpr auto bit_rate = binary_digit_rate; QUANTITY_SPEC(period_of_binary_digits, isq::period, inverse(binary_digit_rate)); -inline constexpr auto bit_period = period_of_binary_digits; +constexpr auto bit_period = period_of_binary_digits; QUANTITY_SPEC(equivalent_binary_digit_rate, binary_digit_rate); -inline constexpr auto equivalent_bit_rate = bit_rate; +constexpr auto equivalent_bit_rate = bit_rate; QUANTITY_SPEC(modulation_rate, inverse(isq::duration)); -inline constexpr auto line_digit_rate = modulation_rate; +constexpr auto line_digit_rate = modulation_rate; QUANTITY_SPEC(quantizing_distortion_power, isq::power); QUANTITY_SPEC(carrier_power, isq::power); QUANTITY_SPEC(signal_energy_per_binary_digit, carrier_power* period_of_binary_digits); QUANTITY_SPEC(error_probability, dimensionless); QUANTITY_SPEC(Hamming_distance, dimensionless); QUANTITY_SPEC(clock_frequency, isq::frequency); -inline constexpr auto clock_rate = clock_frequency; +constexpr auto clock_rate = clock_frequency; QUANTITY_SPEC(decision_content, dimensionless); // TODO how to model information_content and the following quantities??? diff --git a/src/systems/include/mp-units/systems/iec80000/unit_symbols.h b/src/systems/include/mp-units/systems/iec80000/unit_symbols.h index 53d423a8..873d731f 100644 --- a/src/systems/include/mp-units/systems/iec80000/unit_symbols.h +++ b/src/systems/include/mp-units/systems/iec80000/unit_symbols.h @@ -31,81 +31,81 @@ MP_UNITS_EXPORT namespace mp_units::iec80000::unit_symbols { // bit -inline constexpr auto kbit = si::kilo; -inline constexpr auto Mbit = si::mega; -inline constexpr auto Gbit = si::giga; -inline constexpr auto Tbit = si::tera; -inline constexpr auto Pbit = si::peta; -inline constexpr auto Ebit = si::exa; -inline constexpr auto Zbit = si::zetta; -inline constexpr auto Ybit = si::yotta; -inline constexpr auto Rbit = si::ronna; -inline constexpr auto Qbit = si::quetta; +constexpr auto kbit = si::kilo; +constexpr auto Mbit = si::mega; +constexpr auto Gbit = si::giga; +constexpr auto Tbit = si::tera; +constexpr auto Pbit = si::peta; +constexpr auto Ebit = si::exa; +constexpr auto Zbit = si::zetta; +constexpr auto Ybit = si::yotta; +constexpr auto Rbit = si::ronna; +constexpr auto Qbit = si::quetta; -inline constexpr auto Kibit = kibi; -inline constexpr auto Mibit = mebi; -inline constexpr auto Gibit = gibi; -inline constexpr auto Tibit = tebi; -inline constexpr auto Pibit = pebi; -inline constexpr auto Eibit = exbi; +constexpr auto Kibit = kibi; +constexpr auto Mibit = mebi; +constexpr auto Gibit = gibi; +constexpr auto Tibit = tebi; +constexpr auto Pibit = pebi; +constexpr auto Eibit = exbi; // octet -inline constexpr auto o = octet; +constexpr auto o = octet; -inline constexpr auto ko = si::kilo; -inline constexpr auto Mo = si::mega; -inline constexpr auto Go = si::giga; -inline constexpr auto To = si::tera; -inline constexpr auto Po = si::peta; -inline constexpr auto Eo = si::exa; -inline constexpr auto Zo = si::zetta; -inline constexpr auto Yo = si::yotta; -inline constexpr auto Ro = si::ronna; -inline constexpr auto Qo = si::quetta; +constexpr auto ko = si::kilo; +constexpr auto Mo = si::mega; +constexpr auto Go = si::giga; +constexpr auto To = si::tera; +constexpr auto Po = si::peta; +constexpr auto Eo = si::exa; +constexpr auto Zo = si::zetta; +constexpr auto Yo = si::yotta; +constexpr auto Ro = si::ronna; +constexpr auto Qo = si::quetta; -inline constexpr auto Kio = kibi; -inline constexpr auto Mio = mebi; -inline constexpr auto Gio = gibi; -inline constexpr auto Tio = tebi; -inline constexpr auto Pio = pebi; -inline constexpr auto Eio = exbi; +constexpr auto Kio = kibi; +constexpr auto Mio = mebi; +constexpr auto Gio = gibi; +constexpr auto Tio = tebi; +constexpr auto Pio = pebi; +constexpr auto Eio = exbi; // byte -inline constexpr auto B = byte; +constexpr auto B = byte; -inline constexpr auto kB = si::kilo; -inline constexpr auto MB = si::mega; -inline constexpr auto GB = si::giga; -inline constexpr auto TB = si::tera; -inline constexpr auto PB = si::peta; -inline constexpr auto EB = si::exa; -inline constexpr auto ZB = si::zetta; -inline constexpr auto YB = si::yotta; -inline constexpr auto RB = si::ronna; -inline constexpr auto QB = si::quetta; +constexpr auto kB = si::kilo; +constexpr auto MB = si::mega; +constexpr auto GB = si::giga; +constexpr auto TB = si::tera; +constexpr auto PB = si::peta; +constexpr auto EB = si::exa; +constexpr auto ZB = si::zetta; +constexpr auto YB = si::yotta; +constexpr auto RB = si::ronna; +constexpr auto QB = si::quetta; -inline constexpr auto KiB = kibi; -inline constexpr auto MiB = mebi; -inline constexpr auto GiB = gibi; -inline constexpr auto TiB = tebi; -inline constexpr auto PiB = pebi; -inline constexpr auto EiB = exbi; +constexpr auto KiB = kibi; +constexpr auto MiB = mebi; +constexpr auto GiB = gibi; +constexpr auto TiB = tebi; +constexpr auto PiB = pebi; +constexpr auto EiB = exbi; // baud -inline constexpr auto Bd = baud; -inline constexpr auto kBd = si::kilo; -inline constexpr auto MBd = si::mega; -inline constexpr auto GBd = si::giga; -inline constexpr auto TBd = si::tera; -inline constexpr auto PBd = si::peta; -inline constexpr auto EBd = si::exa; -inline constexpr auto ZBd = si::zetta; -inline constexpr auto YBd = si::yotta; -inline constexpr auto RBd = si::ronna; -inline constexpr auto QBd = si::quetta; +constexpr auto Bd = baud; +constexpr auto kBd = si::kilo; +constexpr auto MBd = si::mega; +constexpr auto GBd = si::giga; +constexpr auto TBd = si::tera; +constexpr auto PBd = si::peta; +constexpr auto EBd = si::exa; +constexpr auto ZBd = si::zetta; +constexpr auto YBd = si::yotta; +constexpr auto RBd = si::ronna; +constexpr auto QBd = si::quetta; // erlang // TODO do we need prefixed versions of Erlang? -inline constexpr auto E = erlang; +constexpr auto E = erlang; } // namespace mp_units::iec80000::unit_symbols diff --git a/src/systems/include/mp-units/systems/iec80000/units.h b/src/systems/include/mp-units/systems/iec80000/units.h index 4d1ee098..41f28c5f 100644 --- a/src/systems/include/mp-units/systems/iec80000/units.h +++ b/src/systems/include/mp-units/systems/iec80000/units.h @@ -34,11 +34,11 @@ MP_UNITS_EXPORT namespace mp_units::iec80000 { // clang-format off -inline constexpr struct erlang final : named_unit<"E", kind_of> {} erlang; -inline constexpr struct bit final : named_unit<"bit", one, kind_of> {} bit; -inline constexpr struct octet final : named_unit<"o", mag<8> * bit> {} octet; -inline constexpr struct byte final : named_unit<"B", mag<8> * bit> {} byte; -inline constexpr struct baud final : named_unit<"Bd", one / si::second, kind_of> {} baud; +constexpr struct erlang final : named_unit<"E", kind_of> {} erlang; +constexpr struct bit final : named_unit<"bit", one, kind_of> {} bit; +constexpr struct octet final : named_unit<"o", mag<8> * bit> {} octet; +constexpr struct byte final : named_unit<"B", mag<8> * bit> {} byte; +constexpr struct baud final : named_unit<"Bd", one / si::second, kind_of> {} baud; // clang-format on } // namespace mp_units::iec80000 diff --git a/src/systems/include/mp-units/systems/imperial.h b/src/systems/include/mp-units/systems/imperial.h index 8ba61e05..8c80ce56 100644 --- a/src/systems/include/mp-units/systems/imperial.h +++ b/src/systems/include/mp-units/systems/imperial.h @@ -39,67 +39,67 @@ using namespace international; // clang-format off // https://en.wikipedia.org/wiki/Imperial_units#Length -inline constexpr struct hand final : named_unit<"hh", mag_ratio<1, 3> * foot> {} hand; -inline constexpr struct barleycorn final : named_unit<"Bc", mag_ratio<1, 3> * inch> {} barleycorn; -inline constexpr struct thou final : named_unit<"th", mag_ratio<1, 12'000> * foot> {} thou; -inline constexpr struct chain final : named_unit<"ch", mag<22> * yard> {} chain; -inline constexpr struct furlong final : named_unit<"fur", mag<10> * chain> {} furlong; +constexpr struct hand final : named_unit<"hh", mag_ratio<1, 3> * foot> {} hand; +constexpr struct barleycorn final : named_unit<"Bc", mag_ratio<1, 3> * inch> {} barleycorn; +constexpr struct thou final : named_unit<"th", mag_ratio<1, 12'000> * foot> {} thou; +constexpr struct chain final : named_unit<"ch", mag<22> * yard> {} chain; +constexpr struct furlong final : named_unit<"fur", mag<10> * chain> {} furlong; // maritime units -inline constexpr struct cable final : named_unit<"cb", mag_ratio<1, 10> * nautical_mile> {} cable; -inline constexpr struct fathom final : named_unit<"ftm", mag_ratio<1, 1000> * nautical_mile> {} fathom; +constexpr struct cable final : named_unit<"cb", mag_ratio<1, 10> * nautical_mile> {} cable; +constexpr struct fathom final : named_unit<"ftm", mag_ratio<1, 1000> * nautical_mile> {} fathom; // survey -inline constexpr struct link final : named_unit<"li", mag_ratio<1, 100> * chain> {} link; -inline constexpr struct rod final : named_unit<"rd", mag<25> * link> {} rod; +constexpr struct link final : named_unit<"li", mag_ratio<1, 100> * chain> {} link; +constexpr struct rod final : named_unit<"rd", mag<25> * link> {} rod; // https://en.wikipedia.org/wiki/Imperial_units#Area -inline constexpr struct perch final : named_unit<"perch", square(rod)> {} perch; -inline constexpr struct rood final : named_unit<"rood", mag<40> * perch> {} rood; -inline constexpr struct acre final : named_unit<"acre", mag<4> * rood> {} acre; +constexpr struct perch final : named_unit<"perch", square(rod)> {} perch; +constexpr struct rood final : named_unit<"rood", mag<40> * perch> {} rood; +constexpr struct acre final : named_unit<"acre", mag<4> * rood> {} acre; // https://en.wikipedia.org/wiki/Imperial_units#Volume -inline constexpr struct gallon final : named_unit<"gal", mag_ratio<454'609, 100'000> * si::litre> {} gallon; -inline constexpr struct quart final : named_unit<"qt", mag_ratio<1, 4> * gallon> {} quart; -inline constexpr struct pint final : named_unit<"pt", mag_ratio<1, 2> * quart> {} pint; -inline constexpr struct gill final : named_unit<"gi", mag_ratio<1, 4> * pint> {} gill; -inline constexpr struct fluid_ounce final : named_unit<"fl oz", mag_ratio<1, 5> * gill> {} fluid_ounce; +constexpr struct gallon final : named_unit<"gal", mag_ratio<454'609, 100'000> * si::litre> {} gallon; +constexpr struct quart final : named_unit<"qt", mag_ratio<1, 4> * gallon> {} quart; +constexpr struct pint final : named_unit<"pt", mag_ratio<1, 2> * quart> {} pint; +constexpr struct gill final : named_unit<"gi", mag_ratio<1, 4> * pint> {} gill; +constexpr struct fluid_ounce final : named_unit<"fl oz", mag_ratio<1, 5> * gill> {} fluid_ounce; // https://en.wikipedia.org/wiki/Avoirdupois_system#Post-Elizabethan_units -inline constexpr auto drachm = dram; -inline constexpr struct stone final : named_unit<"st", mag<14> * pound> {} stone; -inline constexpr struct quarter final : named_unit<"qr", mag<2> * stone> {} quarter; -inline constexpr struct long_hundredweight final : named_unit<"cwt", mag<8> * stone> {} long_hundredweight; -inline constexpr struct ton final : named_unit<"t", mag<2'240> * pound> {} ton; -inline constexpr auto long_ton = ton; +constexpr auto drachm = dram; +constexpr struct stone final : named_unit<"st", mag<14> * pound> {} stone; +constexpr struct quarter final : named_unit<"qr", mag<2> * stone> {} quarter; +constexpr struct long_hundredweight final : named_unit<"cwt", mag<8> * stone> {} long_hundredweight; +constexpr struct ton final : named_unit<"t", mag<2'240> * pound> {} ton; +constexpr auto long_ton = ton; // clang-format on namespace unit_symbols { using namespace international::unit_symbols; -inline constexpr auto hh = hand; -inline constexpr auto Bc = barleycorn; -inline constexpr auto th = thou; -inline constexpr auto ch = chain; -inline constexpr auto fur = furlong; +constexpr auto hh = hand; +constexpr auto Bc = barleycorn; +constexpr auto th = thou; +constexpr auto ch = chain; +constexpr auto fur = furlong; -inline constexpr auto cb = cable; -inline constexpr auto ftm = fathom; +constexpr auto cb = cable; +constexpr auto ftm = fathom; -inline constexpr auto li = link; -inline constexpr auto rd = rod; +constexpr auto li = link; +constexpr auto rd = rod; -inline constexpr auto gal = gallon; -inline constexpr auto qt = quart; -inline constexpr auto pt = pint; -inline constexpr auto gi = gill; -inline constexpr auto fl_oz = fluid_ounce; +constexpr auto gal = gallon; +constexpr auto qt = quart; +constexpr auto pt = pint; +constexpr auto gi = gill; +constexpr auto fl_oz = fluid_ounce; -inline constexpr auto st = stone; -inline constexpr auto qr = quarter; -inline constexpr auto cwt = long_hundredweight; -inline constexpr auto t = ton; +constexpr auto st = stone; +constexpr auto qr = quarter; +constexpr auto cwt = long_hundredweight; +constexpr auto t = ton; } // namespace unit_symbols diff --git a/src/systems/include/mp-units/systems/international.h b/src/systems/include/mp-units/systems/international.h index 1d5141f6..206e3c7e 100644 --- a/src/systems/include/mp-units/systems/international.h +++ b/src/systems/include/mp-units/systems/international.h @@ -37,72 +37,72 @@ namespace mp_units::international { // clang-format off // mass -inline constexpr struct pound final : named_unit<"lb", mag_ratio<45'359'237, 100'000'000> * si::kilogram> {} pound; -inline constexpr struct ounce final : named_unit<"oz", mag_ratio<1, 16> * pound> {} ounce; -inline constexpr struct dram final : named_unit<"dr", mag_ratio<1, 16> * ounce> {} dram; -inline constexpr struct grain final : named_unit<"gr", mag_ratio<1, 7'000> * pound> {} grain; +constexpr struct pound final : named_unit<"lb", mag_ratio<45'359'237, 100'000'000> * si::kilogram> {} pound; +constexpr struct ounce final : named_unit<"oz", mag_ratio<1, 16> * pound> {} ounce; +constexpr struct dram final : named_unit<"dr", mag_ratio<1, 16> * ounce> {} dram; +constexpr struct grain final : named_unit<"gr", mag_ratio<1, 7'000> * pound> {} grain; // length // https://en.wikipedia.org/wiki/United_States_customary_units#Length -inline constexpr struct yard final : named_unit<"yd", mag_ratio<9'144, 10'000> * si::metre> {} yard; -inline constexpr struct foot final : named_unit<"ft", mag_ratio<1, 3> * yard> {} foot; -inline constexpr struct inch final : named_unit<"in", mag_ratio<1, 12> * foot> {} inch; -inline constexpr struct pica final : named_unit<"P", mag_ratio<1, 6> * inch> {} pica; -inline constexpr struct point final : named_unit<"p", mag_ratio<1, 12> * pica> {} point; -inline constexpr struct mil final : named_unit<"mil", mag_ratio<1, 1'000> * inch> {} mil; -inline constexpr struct twip final : named_unit<"twip", mag_ratio<1, 20> * point> {} twip; -inline constexpr struct mile final : named_unit<"mi", mag<1760> * yard> {} mile; -inline constexpr struct league final : named_unit<"le", mag<3> * mile> {} league; +constexpr struct yard final : named_unit<"yd", mag_ratio<9'144, 10'000> * si::metre> {} yard; +constexpr struct foot final : named_unit<"ft", mag_ratio<1, 3> * yard> {} foot; +constexpr struct inch final : named_unit<"in", mag_ratio<1, 12> * foot> {} inch; +constexpr struct pica final : named_unit<"P", mag_ratio<1, 6> * inch> {} pica; +constexpr struct point final : named_unit<"p", mag_ratio<1, 12> * pica> {} point; +constexpr struct mil final : named_unit<"mil", mag_ratio<1, 1'000> * inch> {} mil; +constexpr struct twip final : named_unit<"twip", mag_ratio<1, 20> * point> {} twip; +constexpr struct mile final : named_unit<"mi", mag<1760> * yard> {} mile; +constexpr struct league final : named_unit<"le", mag<3> * mile> {} league; -inline constexpr struct nautical_mile final : named_unit<"nmi", mag<1852> * si::metre> {} nautical_mile; +constexpr struct nautical_mile final : named_unit<"nmi", mag<1852> * si::metre> {} nautical_mile; // speed -inline constexpr struct knot final : named_unit<"kn", nautical_mile / si::hour> {} knot; +constexpr struct knot final : named_unit<"kn", nautical_mile / si::hour> {} knot; // force // https://en.wikipedia.org/wiki/Poundal -inline constexpr struct poundal final : named_unit<"pdl", pound * foot / square(si::second)> {} poundal; +constexpr struct poundal final : named_unit<"pdl", pound * foot / square(si::second)> {} poundal; // https://en.wikipedia.org/wiki/Pound_(force) -inline constexpr struct pound_force final : named_unit<"lbf", pound * si::standard_gravity> {} pound_force; +constexpr struct pound_force final : named_unit<"lbf", pound * si::standard_gravity> {} pound_force; // https://en.wikipedia.org/wiki/Kip_(unit), -inline constexpr auto kip = si::kilo; +constexpr auto kip = si::kilo; // pressure -inline constexpr struct psi final : named_unit<"psi", pound_force / square(inch)> {} psi; +constexpr struct psi final : named_unit<"psi", pound_force / square(inch)> {} psi; // power // https://en.wikipedia.org/wiki/Horsepower#Definitions -inline constexpr struct mechanical_horsepower final : named_unit<"hp(I)", mag<33'000> * foot * pound_force / si::minute> {} mechanical_horsepower; +constexpr struct mechanical_horsepower final : named_unit<"hp(I)", mag<33'000> * foot * pound_force / si::minute> {} mechanical_horsepower; // clang-format on namespace unit_symbols { -inline constexpr auto lb = pound; -inline constexpr auto oz = ounce; -inline constexpr auto dr = dram; -inline constexpr auto gr = grain; +constexpr auto lb = pound; +constexpr auto oz = ounce; +constexpr auto dr = dram; +constexpr auto gr = grain; -inline constexpr auto yd = yard; -inline constexpr auto ft = foot; -inline constexpr auto in = inch; -inline constexpr auto P = pica; -inline constexpr auto p = point; -inline constexpr auto mi = mile; -inline constexpr auto le = league; +constexpr auto yd = yard; +constexpr auto ft = foot; +constexpr auto in = inch; +constexpr auto P = pica; +constexpr auto p = point; +constexpr auto mi = mile; +constexpr auto le = league; -inline constexpr auto nmi = nautical_mile; +constexpr auto nmi = nautical_mile; -inline constexpr auto kn = knot; -inline constexpr auto kt = knot; -inline constexpr auto mph = mile / si::hour; +constexpr auto kn = knot; +constexpr auto kt = knot; +constexpr auto mph = mile / si::hour; -inline constexpr auto pdl = poundal; -inline constexpr auto lbf = pound_force; +constexpr auto pdl = poundal; +constexpr auto lbf = pound_force; -inline constexpr auto hp = mechanical_horsepower; +constexpr auto hp = mechanical_horsepower; } // namespace unit_symbols diff --git a/src/systems/include/mp-units/systems/isq/base_quantities.h b/src/systems/include/mp-units/systems/isq/base_quantities.h index c7f4f337..7e9ea017 100644 --- a/src/systems/include/mp-units/systems/isq/base_quantities.h +++ b/src/systems/include/mp-units/systems/isq/base_quantities.h @@ -35,20 +35,20 @@ namespace mp_units::isq { // clang-format off // dimensions of base quantities -inline constexpr struct dim_length final : base_dimension<"L"> {} dim_length; -inline constexpr struct dim_mass final : base_dimension<"M"> {} dim_mass; -inline constexpr struct dim_time final : base_dimension<"T"> {} dim_time; -inline constexpr struct dim_electric_current final : base_dimension<"I"> {} dim_electric_current; -inline constexpr struct dim_thermodynamic_temperature final : base_dimension {} dim_thermodynamic_temperature; -inline constexpr struct dim_amount_of_substance final : base_dimension<"N"> {} dim_amount_of_substance; -inline constexpr struct dim_luminous_intensity final : base_dimension<"J"> {} dim_luminous_intensity; +constexpr struct dim_length final : base_dimension<"L"> {} dim_length; +constexpr struct dim_mass final : base_dimension<"M"> {} dim_mass; +constexpr struct dim_time final : base_dimension<"T"> {} dim_time; +constexpr struct dim_electric_current final : base_dimension<"I"> {} dim_electric_current; +constexpr struct dim_thermodynamic_temperature final : base_dimension {} dim_thermodynamic_temperature; +constexpr struct dim_amount_of_substance final : base_dimension<"N"> {} dim_amount_of_substance; +constexpr struct dim_luminous_intensity final : base_dimension<"J"> {} dim_luminous_intensity; // clang-format on // base quantities QUANTITY_SPEC(length, dim_length); QUANTITY_SPEC(mass, dim_mass); QUANTITY_SPEC(time, dim_time); -inline constexpr auto duration = time; +constexpr auto duration = time; QUANTITY_SPEC(electric_current, dim_electric_current); QUANTITY_SPEC(thermodynamic_temperature, dim_thermodynamic_temperature); QUANTITY_SPEC(amount_of_substance, dim_amount_of_substance); diff --git a/src/systems/include/mp-units/systems/isq/electromagnetism.h b/src/systems/include/mp-units/systems/isq/electromagnetism.h index bdb5bc8b..84f556ba 100644 --- a/src/systems/include/mp-units/systems/isq/electromagnetism.h +++ b/src/systems/include/mp-units/systems/isq/electromagnetism.h @@ -39,25 +39,25 @@ namespace mp_units::isq { QUANTITY_SPEC(electric_charge, electric_current* time); QUANTITY_SPEC(electric_charge_density, electric_charge / volume); -inline constexpr auto volume_electric_charge = electric_charge_density; +constexpr auto volume_electric_charge = electric_charge_density; QUANTITY_SPEC(surface_density_of_electric_charge, electric_charge / area); -inline constexpr auto areic_electric_charge = surface_density_of_electric_charge; +constexpr auto areic_electric_charge = surface_density_of_electric_charge; QUANTITY_SPEC(linear_density_of_electric_charge, electric_charge / length); -inline constexpr auto lineic_electric_charge = linear_density_of_electric_charge; +constexpr auto lineic_electric_charge = linear_density_of_electric_charge; QUANTITY_SPEC(electric_dipole_moment, electric_charge* position_vector); // vector QUANTITY_SPEC(electric_polarization, electric_dipole_moment / volume); // vector QUANTITY_SPEC(electric_current_density, electric_charge_density* velocity); // vector -inline constexpr auto areic_electric_current = electric_current_density; +constexpr auto areic_electric_current = electric_current_density; QUANTITY_SPEC(linear_electric_current_density, surface_density_of_electric_charge* velocity); // vector -inline constexpr auto lineic_electric_current = linear_electric_current_density; +constexpr auto lineic_electric_current = linear_electric_current_density; QUANTITY_SPEC(electric_field_strength, force / electric_charge); // vector QUANTITY_SPEC(electric_potential, electric_field_strength* length, quantity_character::scalar); // TODO what is a correct equation here? QUANTITY_SPEC(electric_potential_difference, electric_potential, quantity_character::scalar); QUANTITY_SPEC(voltage, electric_potential); -inline constexpr auto electric_tension = voltage; +constexpr auto electric_tension = voltage; QUANTITY_SPEC(electric_flux_density, electric_polarization); // vector -inline constexpr auto electric_displacement = electric_flux_density; +constexpr auto electric_displacement = electric_flux_density; QUANTITY_SPEC(capacitance, electric_charge / voltage); // TODO how to calculate an argument of a vector product? QUANTITY_SPEC(magnetic_flux_density, force / (electric_charge * velocity), quantity_character::vector); @@ -66,13 +66,13 @@ QUANTITY_SPEC(magnetic_vector_potential, QUANTITY_SPEC(linked_flux, magnetic_vector_potential* displacement, quantity_character::scalar); QUANTITY_SPEC(magnetic_constant, electric_potential* time / (electric_current * length)); // TODO what is a correct equation here? -inline constexpr auto permeability_of_vacuum = magnetic_constant; +constexpr auto permeability_of_vacuum = magnetic_constant; QUANTITY_SPEC(phase_speed_of_electromagnetic_waves, angular_frequency / angular_wavenumber); QUANTITY_SPEC(speed_of_light_in_vacuum, speed); -inline constexpr auto light_speed_in_vacuum = speed_of_light_in_vacuum; -inline constexpr auto luminal_speed = speed_of_light_in_vacuum; +constexpr auto light_speed_in_vacuum = speed_of_light_in_vacuum; +constexpr auto luminal_speed = speed_of_light_in_vacuum; QUANTITY_SPEC(electric_constant, inverse(magnetic_constant* pow<2>(speed_of_light_in_vacuum))); -inline constexpr auto permittivity_of_vacuum = electric_constant; +constexpr auto permittivity_of_vacuum = electric_constant; QUANTITY_SPEC(permittivity, electric_flux_density / electric_field_strength, quantity_character::scalar); QUANTITY_SPEC(relative_permittivity, dimensionless, permittivity / electric_constant); QUANTITY_SPEC(electric_susceptibility, dimensionless, @@ -84,10 +84,10 @@ QUANTITY_SPEC(total_current, electric_current); QUANTITY_SPEC(total_current_density, electric_current_density); // vector QUANTITY_SPEC(magnetic_flux, magnetic_flux_density* area, quantity_character::scalar); QUANTITY_SPEC(magnetic_moment, electric_current* area, quantity_character::vector); -inline constexpr auto magnetic_area_moment = magnetic_moment; +constexpr auto magnetic_area_moment = magnetic_moment; QUANTITY_SPEC(magnetization, magnetic_moment / volume); // vector QUANTITY_SPEC(magnetic_field_strength, magnetization); // vector -inline constexpr auto magnetizing_field = magnetic_field_strength; +constexpr auto magnetizing_field = magnetic_field_strength; QUANTITY_SPEC(permeability, magnetic_flux_density / magnetic_field_strength, quantity_character::scalar); QUANTITY_SPEC(relative_permeability, dimensionless, permeability / magnetic_constant); QUANTITY_SPEC(magnetic_susceptibility, dimensionless, magnetization / magnetic_field_strength, @@ -97,10 +97,10 @@ QUANTITY_SPEC(magnetic_dipole_moment, magnetic_constant* magnetic_moment); // v QUANTITY_SPEC(coercivity, magnetic_field_strength, quantity_character::scalar); QUANTITY_SPEC(electromagnetic_energy_density, electric_field_strength* electric_flux_density, quantity_character::scalar); -inline constexpr auto volumic_electromagnetic_energy = electromagnetic_energy_density; +constexpr auto volumic_electromagnetic_energy = electromagnetic_energy_density; QUANTITY_SPEC(Poynting_vector, electric_field_strength* magnetic_field_strength); // vector QUANTITY_SPEC(source_voltage, voltage); -inline constexpr auto source_tension = source_voltage; +constexpr auto source_tension = source_voltage; QUANTITY_SPEC(scalar_magnetic_potential, electric_current, magnetic_field_strength* length, quantity_character::scalar); // TODO what is a correct equation here? QUANTITY_SPEC(magnetic_tension, electric_current, magnetic_field_strength* position_vector, quantity_character::scalar); @@ -111,26 +111,26 @@ QUANTITY_SPEC(number_of_turns_in_a_winding, dimensionless); QUANTITY_SPEC(reluctance, magnetic_tension / magnetic_flux); QUANTITY_SPEC(permeance, inverse(reluctance)); QUANTITY_SPEC(inductance, linked_flux / electric_current); -inline constexpr auto self_inductance = inductance; +constexpr auto self_inductance = inductance; QUANTITY_SPEC(mutual_inductance, linked_flux / electric_current); QUANTITY_SPEC(coupling_factor, dimensionless, mutual_inductance / pow<1, 2>(pow<2>(self_inductance))); QUANTITY_SPEC(leakage_factor, dimensionless, pow<2>(coupling_factor)); QUANTITY_SPEC(conductivity, electric_current_density / electric_field_strength, quantity_character::scalar); QUANTITY_SPEC(resistivity, inverse(conductivity)); QUANTITY_SPEC(electromagnetism_power, power, voltage* electric_current); -inline constexpr auto instantaneous_power = electromagnetism_power; +constexpr auto instantaneous_power = electromagnetism_power; QUANTITY_SPEC(resistance, voltage / electric_current); QUANTITY_SPEC(conductance, inverse(resistance)); QUANTITY_SPEC(phase_difference, phase_angle); QUANTITY_SPEC(electric_current_phasor, electric_current); QUANTITY_SPEC(voltage_phasor, voltage); QUANTITY_SPEC(impedance, voltage_phasor / electric_current_phasor); -inline constexpr auto complex_impedance = impedance; +constexpr auto complex_impedance = impedance; QUANTITY_SPEC(resistance_to_alternating_current, impedance); QUANTITY_SPEC(reactance, impedance); QUANTITY_SPEC(modulus_of_impedance, impedance); QUANTITY_SPEC(admittance, inverse(impedance)); -inline constexpr auto complex_admittance = admittance; +constexpr auto complex_admittance = admittance; QUANTITY_SPEC(conductance_for_alternating_current, admittance); QUANTITY_SPEC(susceptance, admittance); QUANTITY_SPEC(modulus_of_admittance, admittance); diff --git a/src/systems/include/mp-units/systems/isq/light_and_radiation.h b/src/systems/include/mp-units/systems/isq/light_and_radiation.h index bfca2dbf..bb5b772d 100644 --- a/src/systems/include/mp-units/systems/isq/light_and_radiation.h +++ b/src/systems/include/mp-units/systems/isq/light_and_radiation.h @@ -45,9 +45,9 @@ QUANTITY_SPEC(radiant_energy_density, radiant_energy / volume); QUANTITY_SPEC(spectral_radiant_energy_density_in_terms_of_wavelength, radiant_energy_density / wavelength); QUANTITY_SPEC(spectral_radiant_energy_density_in_terms_of_wavenumber, radiant_energy_density / wavenumber); QUANTITY_SPEC(radiant_flux, power, radiant_energy / time); -inline constexpr auto radiant_power = radiant_flux; +constexpr auto radiant_power = radiant_flux; QUANTITY_SPEC(spectral_radiant_flux, radiant_flux / wavelength); -inline constexpr auto spectral_radiant_power = spectral_radiant_flux; +constexpr auto spectral_radiant_power = spectral_radiant_flux; QUANTITY_SPEC(radiant_intensity, radiant_flux / solid_angular_measure); QUANTITY_SPEC(spectral_radiant_intensity, radiant_intensity / wavelength); QUANTITY_SPEC(radiance, radiant_intensity / area); diff --git a/src/systems/include/mp-units/systems/isq/mechanics.h b/src/systems/include/mp-units/systems/isq/mechanics.h index 41157143..4de54232 100644 --- a/src/systems/include/mp-units/systems/isq/mechanics.h +++ b/src/systems/include/mp-units/systems/isq/mechanics.h @@ -37,24 +37,24 @@ MP_UNITS_EXPORT namespace mp_units::isq { QUANTITY_SPEC(mass_density, mass / volume); -inline constexpr auto density = mass_density; +constexpr auto density = mass_density; QUANTITY_SPEC(specific_volume, inverse(mass_density)); QUANTITY_SPEC(relative_mass_density, mass_density / mass_density); -inline constexpr auto relative_density = relative_mass_density; +constexpr auto relative_density = relative_mass_density; QUANTITY_SPEC(surface_mass_density, mass / area); -inline constexpr auto surface_density = surface_mass_density; +constexpr auto surface_density = surface_mass_density; QUANTITY_SPEC(linear_mass_density, mass / length); -inline constexpr auto linear_density = linear_mass_density; +constexpr auto linear_density = linear_mass_density; QUANTITY_SPEC(momentum, mass* velocity); // vector QUANTITY_SPEC(force, mass* acceleration); // vector // TODO what is a correct equation here? QUANTITY_SPEC(weight, force, mass* acceleration_of_free_fall); // vector // differs from ISO 80000 QUANTITY_SPEC(static_friction_force, force); // vector -inline constexpr auto static_friction = static_friction_force; +constexpr auto static_friction = static_friction_force; QUANTITY_SPEC(kinetic_friction_force, force); // vector -inline constexpr auto dynamic_friction_force = kinetic_friction_force; +constexpr auto dynamic_friction_force = kinetic_friction_force; QUANTITY_SPEC(rolling_resistance, force); // vector -inline constexpr auto rolling_drag = rolling_resistance; -inline constexpr auto rolling_friction_force = rolling_resistance; +constexpr auto rolling_drag = rolling_resistance; +constexpr auto rolling_friction_force = rolling_resistance; QUANTITY_SPEC(drag_force, force); // vector QUANTITY_SPEC(impulse, force* time); // vector QUANTITY_SPEC(angular_momentum, position_vector* momentum); // vector @@ -73,24 +73,24 @@ QUANTITY_SPEC(shear_strain, dimensionless, displacement / thickness, quantity_ch QUANTITY_SPEC(relative_volume_strain, volume / volume); QUANTITY_SPEC(Poisson_number, dimensionless, width / length); QUANTITY_SPEC(modulus_of_elasticity, normal_stress / relative_linear_strain); -inline constexpr auto Young_modulus = modulus_of_elasticity; +constexpr auto Young_modulus = modulus_of_elasticity; QUANTITY_SPEC(modulus_of_rigidity, shear_stress / shear_strain); -inline constexpr auto shear_modulus = modulus_of_rigidity; +constexpr auto shear_modulus = modulus_of_rigidity; QUANTITY_SPEC(modulus_of_compression, pressure / relative_volume_strain); -inline constexpr auto bulk_modulus = modulus_of_compression; +constexpr auto bulk_modulus = modulus_of_compression; QUANTITY_SPEC(compressibility, inverse(volume) * (volume / pressure)); QUANTITY_SPEC(second_axial_moment_of_area, pow<2>(radial_distance) * area); QUANTITY_SPEC(second_polar_moment_of_area, pow<2>(radial_distance) * area); QUANTITY_SPEC(section_modulus, second_axial_moment_of_area / radial_distance); QUANTITY_SPEC(static_friction_coefficient, dimensionless, static_friction_force / force, quantity_character::scalar); -inline constexpr auto static_friction_factor = static_friction_coefficient; -inline constexpr auto coefficient_of_static_friction = static_friction_coefficient; +constexpr auto static_friction_factor = static_friction_coefficient; +constexpr auto coefficient_of_static_friction = static_friction_coefficient; QUANTITY_SPEC(kinetic_friction_factor, dimensionless, kinetic_friction_force / force, quantity_character::scalar); -inline constexpr auto dynamic_friction_factor = kinetic_friction_factor; +constexpr auto dynamic_friction_factor = kinetic_friction_factor; QUANTITY_SPEC(rolling_resistance_factor, force / force, quantity_character::scalar); QUANTITY_SPEC(drag_coefficient, dimensionless, drag_force / (mass_density * pow<2>(speed) * area), quantity_character::scalar); -inline constexpr auto drag_factor = drag_coefficient; +constexpr auto drag_factor = drag_coefficient; QUANTITY_SPEC(dynamic_viscosity, shear_stress* length / velocity, quantity_character::scalar); QUANTITY_SPEC(kinematic_viscosity, dynamic_viscosity / mass_density); QUANTITY_SPEC(surface_tension, force / length, quantity_character::scalar); // TODO what is a correct equation here? @@ -100,7 +100,7 @@ QUANTITY_SPEC(mechanical_energy, energy); // diffe QUANTITY_SPEC(potential_energy, mechanical_energy); // differs from ISO 80000 QUANTITY_SPEC(kinetic_energy, mechanical_energy, mass* pow<2>(speed)); // differs from ISO 80000 QUANTITY_SPEC(mechanical_work, force* displacement, quantity_character::scalar); -inline constexpr auto work = mechanical_work; +constexpr auto work = mechanical_work; QUANTITY_SPEC(mechanical_efficiency, mechanical_power / mechanical_power); QUANTITY_SPEC(mass_flow, mass_density* velocity); // vector QUANTITY_SPEC(mass_flow_rate, mass_flow* area, quantity_character::scalar); diff --git a/src/systems/include/mp-units/systems/isq/si_quantities.h b/src/systems/include/mp-units/systems/isq/si_quantities.h index 9486c3e3..a8b66c27 100644 --- a/src/systems/include/mp-units/systems/isq/si_quantities.h +++ b/src/systems/include/mp-units/systems/isq/si_quantities.h @@ -37,15 +37,15 @@ namespace mp_units::isq { // space and time QUANTITY_SPEC(width, length); -inline constexpr auto breadth = width; +constexpr auto breadth = width; QUANTITY_SPEC(radius, width); // differs from ISO 80000 QUANTITY_SPEC(path_length, length); -inline constexpr auto arc_length = path_length; +constexpr auto arc_length = path_length; QUANTITY_SPEC(area, pow<2>(length)); QUANTITY_SPEC(angular_measure, dimensionless, arc_length / radius, is_kind); QUANTITY_SPEC(solid_angular_measure, dimensionless, area / pow<2>(radius), is_kind); QUANTITY_SPEC(period_duration, duration); -inline constexpr auto period = period_duration; +constexpr auto period = period_duration; QUANTITY_SPEC(frequency, inverse(period_duration)); // mechanics diff --git a/src/systems/include/mp-units/systems/isq/space_and_time.h b/src/systems/include/mp-units/systems/isq/space_and_time.h index 2157a299..d24db136 100644 --- a/src/systems/include/mp-units/systems/isq/space_and_time.h +++ b/src/systems/include/mp-units/systems/isq/space_and_time.h @@ -36,8 +36,8 @@ MP_UNITS_EXPORT namespace mp_units::isq { QUANTITY_SPEC(height, length); -inline constexpr auto depth = height; -inline constexpr auto altitude = height; +constexpr auto depth = height; +constexpr auto altitude = height; QUANTITY_SPEC(thickness, width); QUANTITY_SPEC(diameter, width); QUANTITY_SPEC(distance, path_length); @@ -48,7 +48,7 @@ QUANTITY_SPEC(radius_of_curvature, radius); QUANTITY_SPEC(curvature, inverse(radius_of_curvature)); QUANTITY_SPEC(volume, pow<3>(length)); QUANTITY_SPEC(rotational_displacement, angular_measure, path_length / radius); -inline constexpr auto angular_displacement = rotational_displacement; +constexpr auto angular_displacement = rotational_displacement; QUANTITY_SPEC(phase_angle, angular_measure); QUANTITY_SPEC(speed, length / time); // differs from ISO 80000 QUANTITY_SPEC(velocity, speed, position_vector / duration); // vector // differs from ISO 80000 @@ -62,18 +62,18 @@ QUANTITY_SPEC(rotational_frequency, rotation / duration); QUANTITY_SPEC(angular_frequency, phase_angle / duration); QUANTITY_SPEC(wavelength, length); QUANTITY_SPEC(repetency, inverse(wavelength)); -inline constexpr auto wavenumber = repetency; +constexpr auto wavenumber = repetency; QUANTITY_SPEC(wave_vector, repetency, quantity_character::vector); QUANTITY_SPEC(angular_repetency, inverse(wavelength)); -inline constexpr auto angular_wavenumber = angular_repetency; +constexpr auto angular_wavenumber = angular_repetency; QUANTITY_SPEC(phase_velocity, angular_frequency / angular_repetency); -inline constexpr auto phase_speed = phase_velocity; +constexpr auto phase_speed = phase_velocity; QUANTITY_SPEC(group_velocity, angular_frequency / angular_repetency); -inline constexpr auto group_speed = group_velocity; +constexpr auto group_speed = group_velocity; QUANTITY_SPEC(damping_coefficient, inverse(time_constant)); QUANTITY_SPEC(logarithmic_decrement, dimensionless, damping_coefficient* period_duration); QUANTITY_SPEC(attenuation, inverse(distance)); -inline constexpr auto extinction = attenuation; +constexpr auto extinction = attenuation; QUANTITY_SPEC(phase_coefficient, phase_angle / path_length); QUANTITY_SPEC(propagation_coefficient, inverse(length)); // γ = α + iβ where α denotes attenuation // and β the phase coefficient of a plane wave diff --git a/src/systems/include/mp-units/systems/isq/thermodynamics.h b/src/systems/include/mp-units/systems/isq/thermodynamics.h index aed8edf9..f5b72d90 100644 --- a/src/systems/include/mp-units/systems/isq/thermodynamics.h +++ b/src/systems/include/mp-units/systems/isq/thermodynamics.h @@ -46,7 +46,7 @@ QUANTITY_SPEC(isothermal_compressibility, inverse(volume) * (volume / pressure)) QUANTITY_SPEC(isentropic_compressibility, inverse(volume) * (volume / pressure)); // TODO how to handle "negative" part // energy definition moved to mechanics QUANTITY_SPEC(heat, energy); -inline constexpr auto amount_of_heat = heat; +constexpr auto amount_of_heat = heat; QUANTITY_SPEC(latent_heat, heat); // TODO what is a correct equation here? QUANTITY_SPEC(heat_flow_rate, heat / time); QUANTITY_SPEC(density_of_heat_flow_rate, heat_flow_rate / area); @@ -54,7 +54,7 @@ QUANTITY_SPEC(thermal_conductivity, density_of_heat_flow_rate*(length / thermody QUANTITY_SPEC(coefficient_of_heat_transfer, density_of_heat_flow_rate / thermodynamic_temperature); QUANTITY_SPEC(surface_coefficient_of_heat_transfer, density_of_heat_flow_rate / thermodynamic_temperature); QUANTITY_SPEC(thermal_insulance, inverse(coefficient_of_heat_transfer)); -inline constexpr auto coefficient_of_thermal_insulance = thermal_insulance; +constexpr auto coefficient_of_thermal_insulance = thermal_insulance; QUANTITY_SPEC(thermal_resistance, thermodynamic_temperature / heat_flow_rate); QUANTITY_SPEC(thermal_conductance, inverse(thermal_resistance)); QUANTITY_SPEC(heat_capacity, heat / thermodynamic_temperature); @@ -67,24 +67,24 @@ QUANTITY_SPEC(ratio_of_specific_heat_capacities, dimensionless, specific_heat_capacity_at_constant_pressure / specific_heat_capacity_at_constant_volume); QUANTITY_SPEC(isentropic_exponent, volume / pressure * (pressure / volume)); // TODO how to handle "negative" part -inline constexpr auto isentropic_expansion_factor = isentropic_exponent; +constexpr auto isentropic_expansion_factor = isentropic_exponent; QUANTITY_SPEC(entropy, kinetic_energy / thermodynamic_temperature); QUANTITY_SPEC(specific_entropy, entropy / mass); QUANTITY_SPEC(enthalpy, energy); // differs from ISO 80000 QUANTITY_SPEC(internal_energy, enthalpy); // differs from ISO 80000 -inline constexpr auto thermodynamic_energy = internal_energy; +constexpr auto thermodynamic_energy = internal_energy; QUANTITY_SPEC(Helmholtz_energy, internal_energy); -inline constexpr auto Helmholtz_function = Helmholtz_energy; +constexpr auto Helmholtz_function = Helmholtz_energy; QUANTITY_SPEC(Gibbs_energy, enthalpy); -inline constexpr auto Gibbs_function = Gibbs_energy; +constexpr auto Gibbs_function = Gibbs_energy; QUANTITY_SPEC(specific_energy, energy / mass); QUANTITY_SPEC(specific_internal_energy, internal_energy / mass); -inline constexpr auto specific_thermodynamic_energy = specific_internal_energy; +constexpr auto specific_thermodynamic_energy = specific_internal_energy; QUANTITY_SPEC(specific_enthalpy, enthalpy / mass); QUANTITY_SPEC(specific_Helmholtz_energy, Helmholtz_energy / mass); -inline constexpr auto specific_Helmholtz_function = specific_Helmholtz_energy; +constexpr auto specific_Helmholtz_function = specific_Helmholtz_energy; QUANTITY_SPEC(specific_Gibbs_energy, Gibbs_energy / mass); -inline constexpr auto specific_Gibbs_function = specific_Gibbs_energy; +constexpr auto specific_Gibbs_function = specific_Gibbs_energy; QUANTITY_SPEC(Massieu_function, Helmholtz_energy / thermodynamic_temperature); // TODO how to handle "negative" part QUANTITY_SPEC(Planck_function, Gibbs_energy / thermodynamic_temperature); // TODO how to handle "negative" part QUANTITY_SPEC(Joule_Thomson_coefficient, thermodynamic_temperature / pressure); diff --git a/src/systems/include/mp-units/systems/isq_angle.h b/src/systems/include/mp-units/systems/isq_angle.h index bf306d93..69584b94 100644 --- a/src/systems/include/mp-units/systems/isq_angle.h +++ b/src/systems/include/mp-units/systems/isq_angle.h @@ -43,7 +43,7 @@ using namespace isq; QUANTITY_SPEC(cotes_angle_constant, angular::angle); // 1 rad QUANTITY_SPEC(angular_measure, angular::angle, cotes_angle_constant* arc_length / radius); QUANTITY_SPEC(rotational_displacement, angular::angle, cotes_angle_constant* path_length / radius); -inline constexpr auto angular_displacement = rotational_displacement; +constexpr auto angular_displacement = rotational_displacement; QUANTITY_SPEC(phase_angle, angular_measure); QUANTITY_SPEC(solid_angular_measure, pow<2>(cotes_angle_constant) * area / pow<2>(radius)); QUANTITY_SPEC(angular_velocity, angular_displacement / duration, quantity_character::vector); @@ -51,7 +51,7 @@ QUANTITY_SPEC(angular_acceleration, angular_velocity / duration); QUANTITY_SPEC(rotation, rotational_displacement); QUANTITY_SPEC(angular_frequency, phase_angle / duration); QUANTITY_SPEC(angular_repetency, cotes_angle_constant / wavelength); -inline constexpr auto angular_wavenumber = angular_repetency; +constexpr auto angular_wavenumber = angular_repetency; QUANTITY_SPEC(phase_coefficient, phase_angle / path_length); QUANTITY_SPEC(propagation_coefficient, cotes_angle_constant / length); QUANTITY_SPEC(angular_momentum, position_vector* momentum / cotes_angle_constant); // vector @@ -62,6 +62,6 @@ QUANTITY_SPEC(angular_impulse, moment_of_force* time); // vector QUANTITY_SPEC(loss_angle, angular_measure); // constants -inline constexpr auto cotes_angle = cotes_angle_constant[angular::radian]; +constexpr auto cotes_angle = cotes_angle_constant[angular::radian]; } // namespace mp_units::isq_angle diff --git a/src/systems/include/mp-units/systems/natural.h b/src/systems/include/mp-units/systems/natural.h index b5a65b63..23faf2db 100644 --- a/src/systems/include/mp-units/systems/natural.h +++ b/src/systems/include/mp-units/systems/natural.h @@ -38,28 +38,28 @@ namespace mp_units::natural { // clang-format off // units -inline constexpr struct electronvolt final : named_unit<"eV"> {} electronvolt; -inline constexpr auto gigaelectronvolt = si::giga; +constexpr struct electronvolt final : named_unit<"eV"> {} electronvolt; +constexpr auto gigaelectronvolt = si::giga; // system references -inline constexpr struct time : system_reference {} time; -inline constexpr struct length : system_reference {} length; -inline constexpr struct mass : system_reference {} mass; -inline constexpr struct velocity : system_reference {} velocity; -inline constexpr struct speed : system_reference {} speed; -inline constexpr struct acceleration : system_reference {} acceleration; -inline constexpr struct momentum : system_reference {} momentum; -inline constexpr struct force : system_reference {} force; -inline constexpr struct energy : system_reference {} energy; +constexpr struct time : system_reference {} time; +constexpr struct length : system_reference {} length; +constexpr struct mass : system_reference {} mass; +constexpr struct velocity : system_reference {} velocity; +constexpr struct speed : system_reference {} speed; +constexpr struct acceleration : system_reference {} acceleration; +constexpr struct momentum : system_reference {} momentum; +constexpr struct force : system_reference {} force; +constexpr struct energy : system_reference {} energy; // clang-format on // constants -inline constexpr auto speed_of_light = speed[one]; +constexpr auto speed_of_light = speed[one]; namespace unit_symbols { -inline constexpr auto GeV = gigaelectronvolt; -inline constexpr auto GeV2 = square(gigaelectronvolt); +constexpr auto GeV = gigaelectronvolt; +constexpr auto GeV2 = square(gigaelectronvolt); } // namespace unit_symbols diff --git a/src/systems/include/mp-units/systems/si/chrono.h b/src/systems/include/mp-units/systems/si/chrono.h index fa878269..abf15b51 100644 --- a/src/systems/include/mp-units/systems/si/chrono.h +++ b/src/systems/include/mp-units/systems/si/chrono.h @@ -93,7 +93,7 @@ struct chrono_point_origin_ final : absolute_point_origin { using clock = C; }; MP_UNITS_EXPORT template -inline constexpr chrono_point_origin_ chrono_point_origin; +constexpr chrono_point_origin_ chrono_point_origin; MP_UNITS_EXPORT_BEGIN diff --git a/src/systems/include/mp-units/systems/si/constants.h b/src/systems/include/mp-units/systems/si/constants.h index a43c871c..0e47105a 100644 --- a/src/systems/include/mp-units/systems/si/constants.h +++ b/src/systems/include/mp-units/systems/si/constants.h @@ -35,28 +35,28 @@ namespace mp_units::si { namespace si2019 { // clang-format off -inline constexpr struct hyperfine_structure_transition_frequency_of_cs final : +constexpr struct hyperfine_structure_transition_frequency_of_cs final : named_unit * hertz> {} hyperfine_structure_transition_frequency_of_cs; -inline constexpr struct speed_of_light_in_vacuum final : +constexpr struct speed_of_light_in_vacuum final : named_unit<"c", mag<299'792'458> * metre / second> {} speed_of_light_in_vacuum; -inline constexpr struct planck_constant final : +constexpr struct planck_constant final : named_unit<"h", mag_ratio<662'607'015, 100'000'000> * mag_power<10, -34> * joule * second> {} planck_constant; -inline constexpr struct elementary_charge final : +constexpr struct elementary_charge final : named_unit<"e", mag_ratio<1'602'176'634, 1'000'000'000> * mag_power<10, -19> * coulomb> {} elementary_charge; -inline constexpr struct boltzmann_constant final : +constexpr struct boltzmann_constant final : named_unit<"k", mag_ratio<1'380'649, 1'000'000> * mag_power<10, -23> * joule / kelvin> {} boltzmann_constant; -inline constexpr struct avogadro_constant final : +constexpr struct avogadro_constant final : named_unit<"N_A", mag_ratio<602'214'076, 100'000'000> * mag_power<10, 23> / mole> {} avogadro_constant; -inline constexpr struct luminous_efficacy final : +constexpr struct luminous_efficacy final : named_unit<"K_cd", mag<683> * lumen / watt> {} luminous_efficacy; // clang-format on } // namespace si2019 // clang-format off -inline constexpr struct standard_gravity final : +constexpr struct standard_gravity final : named_unit * metre / square(second)> {} standard_gravity; -inline constexpr struct magnetic_constant final : +constexpr struct magnetic_constant final : named_unit * mag_pi * mag_power<10, -7> * henry / metre> {} magnetic_constant; // clang-format on diff --git a/src/systems/include/mp-units/systems/si/prefixes.h b/src/systems/include/mp-units/systems/si/prefixes.h index 3ee39e13..a0efa949 100644 --- a/src/systems/include/mp-units/systems/si/prefixes.h +++ b/src/systems/include/mp-units/systems/si/prefixes.h @@ -58,30 +58,30 @@ template struct quetta_ final : prefixed_unit<"Q", mag_power<1 MP_UNITS_EXPORT_BEGIN -template inline constexpr quecto_ quecto; -template inline constexpr ronto_ ronto; -template inline constexpr yocto_ yocto; -template inline constexpr zepto_ zepto; -template inline constexpr atto_ atto; -template inline constexpr femto_ femto; -template inline constexpr pico_ pico; -template inline constexpr nano_ nano; -template inline constexpr micro_ micro; -template inline constexpr milli_ milli; -template inline constexpr centi_ centi; -template inline constexpr deci_ deci; -template inline constexpr deca_ deca; -template inline constexpr hecto_ hecto; -template inline constexpr kilo_ kilo; -template inline constexpr mega_ mega; -template inline constexpr giga_ giga; -template inline constexpr tera_ tera; -template inline constexpr peta_ peta; -template inline constexpr exa_ exa; -template inline constexpr zetta_ zetta; -template inline constexpr yotta_ yotta; -template inline constexpr ronna_ ronna; -template inline constexpr quetta_ quetta; +template constexpr quecto_ quecto; +template constexpr ronto_ ronto; +template constexpr yocto_ yocto; +template constexpr zepto_ zepto; +template constexpr atto_ atto; +template constexpr femto_ femto; +template constexpr pico_ pico; +template constexpr nano_ nano; +template constexpr micro_ micro; +template constexpr milli_ milli; +template constexpr centi_ centi; +template constexpr deci_ deci; +template constexpr deca_ deca; +template constexpr hecto_ hecto; +template constexpr kilo_ kilo; +template constexpr mega_ mega; +template constexpr giga_ giga; +template constexpr tera_ tera; +template constexpr peta_ peta; +template constexpr exa_ exa; +template constexpr zetta_ zetta; +template constexpr yotta_ yotta; +template constexpr ronna_ ronna; +template constexpr quetta_ quetta; // clang-format on MP_UNITS_EXPORT_END diff --git a/src/systems/include/mp-units/systems/si/unit_symbols.h b/src/systems/include/mp-units/systems/si/unit_symbols.h index 466c956c..ce5e68d8 100644 --- a/src/systems/include/mp-units/systems/si/unit_symbols.h +++ b/src/systems/include/mp-units/systems/si/unit_symbols.h @@ -31,774 +31,774 @@ namespace mp_units { namespace si::unit_symbols { -inline constexpr auto qm = quecto; -inline constexpr auto rm = ronto; -inline constexpr auto ym = yocto; -inline constexpr auto zm = zepto; -inline constexpr auto am = atto; -inline constexpr auto fm = femto; -inline constexpr auto pm = pico; -inline constexpr auto nm = nano; -inline constexpr auto um = micro; -inline constexpr auto mm = milli; -inline constexpr auto cm = centi; -inline constexpr auto dm = deci; -inline constexpr auto m = metre; -inline constexpr auto dam = deca; -inline constexpr auto hm = hecto; -inline constexpr auto km = kilo; -inline constexpr auto Mm = mega; -inline constexpr auto Gm = giga; -inline constexpr auto Tm = tera; -inline constexpr auto Pm = peta; -inline constexpr auto Em = exa; -inline constexpr auto Zm = zetta; -inline constexpr auto Ym = yotta; -inline constexpr auto Rm = ronna; -inline constexpr auto Qm = quetta; +constexpr auto qm = quecto; +constexpr auto rm = ronto; +constexpr auto ym = yocto; +constexpr auto zm = zepto; +constexpr auto am = atto; +constexpr auto fm = femto; +constexpr auto pm = pico; +constexpr auto nm = nano; +constexpr auto um = micro; +constexpr auto mm = milli; +constexpr auto cm = centi; +constexpr auto dm = deci; +constexpr auto m = metre; +constexpr auto dam = deca; +constexpr auto hm = hecto; +constexpr auto km = kilo; +constexpr auto Mm = mega; +constexpr auto Gm = giga; +constexpr auto Tm = tera; +constexpr auto Pm = peta; +constexpr auto Em = exa; +constexpr auto Zm = zetta; +constexpr auto Ym = yotta; +constexpr auto Rm = ronna; +constexpr auto Qm = quetta; -inline constexpr auto qs = quecto; -inline constexpr auto rs = ronto; -inline constexpr auto ys = yocto; -inline constexpr auto zs = zepto; -inline constexpr auto as = atto; -inline constexpr auto fs = femto; -inline constexpr auto ps = pico; -inline constexpr auto ns = nano; -inline constexpr auto us = micro; -inline constexpr auto ms = milli; -inline constexpr auto cs = centi; -inline constexpr auto ds = deci; -inline constexpr auto s = second; +constexpr auto qs = quecto; +constexpr auto rs = ronto; +constexpr auto ys = yocto; +constexpr auto zs = zepto; +constexpr auto as = atto; +constexpr auto fs = femto; +constexpr auto ps = pico; +constexpr auto ns = nano; +constexpr auto us = micro; +constexpr auto ms = milli; +constexpr auto cs = centi; +constexpr auto ds = deci; +constexpr auto s = second; // TODO Should the below multiples of second be provided? -inline constexpr auto das = deca; -inline constexpr auto hs = hecto; -inline constexpr auto ks = kilo; -inline constexpr auto Ms = mega; -inline constexpr auto Gs = giga; -inline constexpr auto Ts = tera; -inline constexpr auto Ps = peta; -inline constexpr auto Es = exa; -inline constexpr auto Zs = zetta; -inline constexpr auto Ys = yotta; -inline constexpr auto Rs = ronna; -inline constexpr auto Qs = quetta; +constexpr auto das = deca; +constexpr auto hs = hecto; +constexpr auto ks = kilo; +constexpr auto Ms = mega; +constexpr auto Gs = giga; +constexpr auto Ts = tera; +constexpr auto Ps = peta; +constexpr auto Es = exa; +constexpr auto Zs = zetta; +constexpr auto Ys = yotta; +constexpr auto Rs = ronna; +constexpr auto Qs = quetta; -inline constexpr auto qg = quecto; -inline constexpr auto rg = ronto; -inline constexpr auto yg = yocto; -inline constexpr auto zg = zepto; -inline constexpr auto ag = atto; -inline constexpr auto fg = femto; -inline constexpr auto pg = pico; -inline constexpr auto ng = nano; -inline constexpr auto ug = micro; -inline constexpr auto mg = milli; -inline constexpr auto cg = centi; -inline constexpr auto dg = deci; -inline constexpr auto g = gram; -inline constexpr auto dag = deca; -inline constexpr auto hg = hecto; -inline constexpr auto kg = kilogram; -inline constexpr auto Mg = mega; -inline constexpr auto Gg = giga; -inline constexpr auto Tg = tera; -inline constexpr auto Pg = peta; -inline constexpr auto Eg = exa; -inline constexpr auto Zg = zetta; -inline constexpr auto Yg = yotta; -inline constexpr auto Rg = ronna; -inline constexpr auto Qg = quetta; +constexpr auto qg = quecto; +constexpr auto rg = ronto; +constexpr auto yg = yocto; +constexpr auto zg = zepto; +constexpr auto ag = atto; +constexpr auto fg = femto; +constexpr auto pg = pico; +constexpr auto ng = nano; +constexpr auto ug = micro; +constexpr auto mg = milli; +constexpr auto cg = centi; +constexpr auto dg = deci; +constexpr auto g = gram; +constexpr auto dag = deca; +constexpr auto hg = hecto; +constexpr auto kg = kilogram; +constexpr auto Mg = mega; +constexpr auto Gg = giga; +constexpr auto Tg = tera; +constexpr auto Pg = peta; +constexpr auto Eg = exa; +constexpr auto Zg = zetta; +constexpr auto Yg = yotta; +constexpr auto Rg = ronna; +constexpr auto Qg = quetta; -inline constexpr auto qA = quecto; -inline constexpr auto rA = ronto; -inline constexpr auto yA = yocto; -inline constexpr auto zA = zepto; -inline constexpr auto aA = atto; -inline constexpr auto fA = femto; -inline constexpr auto pA = pico; -inline constexpr auto nA = nano; -inline constexpr auto uA = micro; -inline constexpr auto mA = milli; -inline constexpr auto cA = centi; -inline constexpr auto dA = deci; -inline constexpr auto A = ampere; -inline constexpr auto daA = deca; -inline constexpr auto hA = hecto; -inline constexpr auto kA = kilo; -inline constexpr auto MA = mega; -inline constexpr auto GA = giga; -inline constexpr auto TA = tera; -inline constexpr auto PA = peta; -inline constexpr auto EA = exa; -inline constexpr auto ZA = zetta; -inline constexpr auto YA = yotta; -inline constexpr auto RA = ronna; -inline constexpr auto QA = quetta; +constexpr auto qA = quecto; +constexpr auto rA = ronto; +constexpr auto yA = yocto; +constexpr auto zA = zepto; +constexpr auto aA = atto; +constexpr auto fA = femto; +constexpr auto pA = pico; +constexpr auto nA = nano; +constexpr auto uA = micro; +constexpr auto mA = milli; +constexpr auto cA = centi; +constexpr auto dA = deci; +constexpr auto A = ampere; +constexpr auto daA = deca; +constexpr auto hA = hecto; +constexpr auto kA = kilo; +constexpr auto MA = mega; +constexpr auto GA = giga; +constexpr auto TA = tera; +constexpr auto PA = peta; +constexpr auto EA = exa; +constexpr auto ZA = zetta; +constexpr auto YA = yotta; +constexpr auto RA = ronna; +constexpr auto QA = quetta; -inline constexpr auto qK = quecto; -inline constexpr auto rK = ronto; -inline constexpr auto yK = yocto; -inline constexpr auto zK = zepto; -inline constexpr auto aK = atto; -inline constexpr auto fK = femto; -inline constexpr auto pK = pico; -inline constexpr auto nK = nano; -inline constexpr auto uK = micro; -inline constexpr auto mK = milli; -inline constexpr auto cK = centi; -inline constexpr auto dK = deci; -inline constexpr auto K = kelvin; -inline constexpr auto daK = deca; -inline constexpr auto hK = hecto; -inline constexpr auto kK = kilo; -inline constexpr auto MK = mega; -inline constexpr auto GK = giga; -inline constexpr auto TK = tera; -inline constexpr auto PK = peta; -inline constexpr auto EK = exa; -inline constexpr auto ZK = zetta; -inline constexpr auto YK = yotta; -inline constexpr auto RK = ronna; -inline constexpr auto QK = quetta; +constexpr auto qK = quecto; +constexpr auto rK = ronto; +constexpr auto yK = yocto; +constexpr auto zK = zepto; +constexpr auto aK = atto; +constexpr auto fK = femto; +constexpr auto pK = pico; +constexpr auto nK = nano; +constexpr auto uK = micro; +constexpr auto mK = milli; +constexpr auto cK = centi; +constexpr auto dK = deci; +constexpr auto K = kelvin; +constexpr auto daK = deca; +constexpr auto hK = hecto; +constexpr auto kK = kilo; +constexpr auto MK = mega; +constexpr auto GK = giga; +constexpr auto TK = tera; +constexpr auto PK = peta; +constexpr auto EK = exa; +constexpr auto ZK = zetta; +constexpr auto YK = yotta; +constexpr auto RK = ronna; +constexpr auto QK = quetta; -inline constexpr auto qmol = quecto; -inline constexpr auto rmol = ronto; -inline constexpr auto ymol = yocto; -inline constexpr auto zmol = zepto; -inline constexpr auto amol = atto; -inline constexpr auto fmol = femto; -inline constexpr auto pmol = pico; -inline constexpr auto nmol = nano; -inline constexpr auto umol = micro; -inline constexpr auto mmol = milli; -inline constexpr auto cmol = centi; -inline constexpr auto dmol = deci; -inline constexpr auto mol = mole; -inline constexpr auto damol = deca; -inline constexpr auto hmol = hecto; -inline constexpr auto kmol = kilo; -inline constexpr auto Mmol = mega; -inline constexpr auto Gmol = giga; -inline constexpr auto Tmol = tera; -inline constexpr auto Pmol = peta; -inline constexpr auto Emol = exa; -inline constexpr auto Zmol = zetta; -inline constexpr auto Ymol = yotta; -inline constexpr auto Rmol = ronna; -inline constexpr auto Qmol = quetta; +constexpr auto qmol = quecto; +constexpr auto rmol = ronto; +constexpr auto ymol = yocto; +constexpr auto zmol = zepto; +constexpr auto amol = atto; +constexpr auto fmol = femto; +constexpr auto pmol = pico; +constexpr auto nmol = nano; +constexpr auto umol = micro; +constexpr auto mmol = milli; +constexpr auto cmol = centi; +constexpr auto dmol = deci; +constexpr auto mol = mole; +constexpr auto damol = deca; +constexpr auto hmol = hecto; +constexpr auto kmol = kilo; +constexpr auto Mmol = mega; +constexpr auto Gmol = giga; +constexpr auto Tmol = tera; +constexpr auto Pmol = peta; +constexpr auto Emol = exa; +constexpr auto Zmol = zetta; +constexpr auto Ymol = yotta; +constexpr auto Rmol = ronna; +constexpr auto Qmol = quetta; -inline constexpr auto qcd = quecto; -inline constexpr auto rcd = ronto; -inline constexpr auto ycd = yocto; -inline constexpr auto zcd = zepto; -inline constexpr auto acd = atto; -inline constexpr auto fcd = femto; -inline constexpr auto pcd = pico; -inline constexpr auto ncd = nano; -inline constexpr auto ucd = micro; -inline constexpr auto mcd = milli; -inline constexpr auto ccd = centi; -inline constexpr auto dcd = deci; -inline constexpr auto cd = candela; -inline constexpr auto dacd = deca; -inline constexpr auto hcd = hecto; -inline constexpr auto kcd = kilo; -inline constexpr auto Mcd = mega; -inline constexpr auto Gcd = giga; -inline constexpr auto Tcd = tera; -inline constexpr auto Pcd = peta; -inline constexpr auto Ecd = exa; -inline constexpr auto Zcd = zetta; -inline constexpr auto Ycd = yotta; -inline constexpr auto Rcd = ronna; -inline constexpr auto Qcd = quetta; +constexpr auto qcd = quecto; +constexpr auto rcd = ronto; +constexpr auto ycd = yocto; +constexpr auto zcd = zepto; +constexpr auto acd = atto; +constexpr auto fcd = femto; +constexpr auto pcd = pico; +constexpr auto ncd = nano; +constexpr auto ucd = micro; +constexpr auto mcd = milli; +constexpr auto ccd = centi; +constexpr auto dcd = deci; +constexpr auto cd = candela; +constexpr auto dacd = deca; +constexpr auto hcd = hecto; +constexpr auto kcd = kilo; +constexpr auto Mcd = mega; +constexpr auto Gcd = giga; +constexpr auto Tcd = tera; +constexpr auto Pcd = peta; +constexpr auto Ecd = exa; +constexpr auto Zcd = zetta; +constexpr auto Ycd = yotta; +constexpr auto Rcd = ronna; +constexpr auto Qcd = quetta; -inline constexpr auto qrad = quecto; -inline constexpr auto rrad = ronto; -inline constexpr auto yrad = yocto; -inline constexpr auto zrad = zepto; -inline constexpr auto arad = atto; -inline constexpr auto frad = femto; -inline constexpr auto prad = pico; -inline constexpr auto nrad = nano; -inline constexpr auto urad = micro; -inline constexpr auto mrad = milli; -inline constexpr auto crad = centi; -inline constexpr auto drad = deci; -inline constexpr auto rad = radian; -inline constexpr auto darad = deca; -inline constexpr auto hrad = hecto; -inline constexpr auto krad = kilo; -inline constexpr auto Mrad = mega; -inline constexpr auto Grad = giga; -inline constexpr auto Trad = tera; -inline constexpr auto Prad = peta; -inline constexpr auto Erad = exa; -inline constexpr auto Zrad = zetta; -inline constexpr auto Yrad = yotta; -inline constexpr auto Rrad = ronna; -inline constexpr auto Qrad = quetta; +constexpr auto qrad = quecto; +constexpr auto rrad = ronto; +constexpr auto yrad = yocto; +constexpr auto zrad = zepto; +constexpr auto arad = atto; +constexpr auto frad = femto; +constexpr auto prad = pico; +constexpr auto nrad = nano; +constexpr auto urad = micro; +constexpr auto mrad = milli; +constexpr auto crad = centi; +constexpr auto drad = deci; +constexpr auto rad = radian; +constexpr auto darad = deca; +constexpr auto hrad = hecto; +constexpr auto krad = kilo; +constexpr auto Mrad = mega; +constexpr auto Grad = giga; +constexpr auto Trad = tera; +constexpr auto Prad = peta; +constexpr auto Erad = exa; +constexpr auto Zrad = zetta; +constexpr auto Yrad = yotta; +constexpr auto Rrad = ronna; +constexpr auto Qrad = quetta; -inline constexpr auto qsr = quecto; -inline constexpr auto rsr = ronto; -inline constexpr auto ysr = yocto; -inline constexpr auto zsr = zepto; -inline constexpr auto asr = atto; -inline constexpr auto fsr = femto; -inline constexpr auto psr = pico; -inline constexpr auto nsr = nano; -inline constexpr auto usr = micro; -inline constexpr auto msr = milli; -inline constexpr auto csr = centi; -inline constexpr auto dsr = deci; -inline constexpr auto sr = steradian; -inline constexpr auto dasr = deca; -inline constexpr auto hsr = hecto; -inline constexpr auto ksr = kilo; -inline constexpr auto Msr = mega; -inline constexpr auto Gsr = giga; -inline constexpr auto Tsr = tera; -inline constexpr auto Psr = peta; -inline constexpr auto Esr = exa; -inline constexpr auto Zsr = zetta; -inline constexpr auto Ysr = yotta; -inline constexpr auto Rsr = ronna; -inline constexpr auto Qsr = quetta; +constexpr auto qsr = quecto; +constexpr auto rsr = ronto; +constexpr auto ysr = yocto; +constexpr auto zsr = zepto; +constexpr auto asr = atto; +constexpr auto fsr = femto; +constexpr auto psr = pico; +constexpr auto nsr = nano; +constexpr auto usr = micro; +constexpr auto msr = milli; +constexpr auto csr = centi; +constexpr auto dsr = deci; +constexpr auto sr = steradian; +constexpr auto dasr = deca; +constexpr auto hsr = hecto; +constexpr auto ksr = kilo; +constexpr auto Msr = mega; +constexpr auto Gsr = giga; +constexpr auto Tsr = tera; +constexpr auto Psr = peta; +constexpr auto Esr = exa; +constexpr auto Zsr = zetta; +constexpr auto Ysr = yotta; +constexpr auto Rsr = ronna; +constexpr auto Qsr = quetta; -inline constexpr auto qHz = quecto; -inline constexpr auto rHz = ronto; -inline constexpr auto yHz = yocto; -inline constexpr auto zHz = zepto; -inline constexpr auto aHz = atto; -inline constexpr auto fHz = femto; -inline constexpr auto pHz = pico; -inline constexpr auto nHz = nano; -inline constexpr auto uHz = micro; -inline constexpr auto mHz = milli; -inline constexpr auto cHz = centi; -inline constexpr auto dHz = deci; -inline constexpr auto Hz = hertz; -inline constexpr auto daHz = deca; -inline constexpr auto hHz = hecto; -inline constexpr auto kHz = kilo; -inline constexpr auto MHz = mega; -inline constexpr auto GHz = giga; -inline constexpr auto THz = tera; -inline constexpr auto PHz = peta; -inline constexpr auto EHz = exa; -inline constexpr auto ZHz = zetta; -inline constexpr auto YHz = yotta; -inline constexpr auto RHz = ronna; -inline constexpr auto QHz = quetta; +constexpr auto qHz = quecto; +constexpr auto rHz = ronto; +constexpr auto yHz = yocto; +constexpr auto zHz = zepto; +constexpr auto aHz = atto; +constexpr auto fHz = femto; +constexpr auto pHz = pico; +constexpr auto nHz = nano; +constexpr auto uHz = micro; +constexpr auto mHz = milli; +constexpr auto cHz = centi; +constexpr auto dHz = deci; +constexpr auto Hz = hertz; +constexpr auto daHz = deca; +constexpr auto hHz = hecto; +constexpr auto kHz = kilo; +constexpr auto MHz = mega; +constexpr auto GHz = giga; +constexpr auto THz = tera; +constexpr auto PHz = peta; +constexpr auto EHz = exa; +constexpr auto ZHz = zetta; +constexpr auto YHz = yotta; +constexpr auto RHz = ronna; +constexpr auto QHz = quetta; -inline constexpr auto qN = quecto; -inline constexpr auto rN = ronto; -inline constexpr auto yN = yocto; -inline constexpr auto zN = zepto; -inline constexpr auto aN = atto; -inline constexpr auto fN = femto; -inline constexpr auto pN = pico; -inline constexpr auto nN = nano; -inline constexpr auto uN = micro; -inline constexpr auto mN = milli; -inline constexpr auto cN = centi; -inline constexpr auto dN = deci; -inline constexpr auto N = newton; -inline constexpr auto daN = deca; -inline constexpr auto hN = hecto; -inline constexpr auto kN = kilo; -inline constexpr auto MN = mega; -inline constexpr auto GN = giga; -inline constexpr auto TN = tera; -inline constexpr auto PN = peta; -inline constexpr auto EN = exa; -inline constexpr auto ZN = zetta; -inline constexpr auto YN = yotta; -inline constexpr auto RN = ronna; -inline constexpr auto QN = quetta; +constexpr auto qN = quecto; +constexpr auto rN = ronto; +constexpr auto yN = yocto; +constexpr auto zN = zepto; +constexpr auto aN = atto; +constexpr auto fN = femto; +constexpr auto pN = pico; +constexpr auto nN = nano; +constexpr auto uN = micro; +constexpr auto mN = milli; +constexpr auto cN = centi; +constexpr auto dN = deci; +constexpr auto N = newton; +constexpr auto daN = deca; +constexpr auto hN = hecto; +constexpr auto kN = kilo; +constexpr auto MN = mega; +constexpr auto GN = giga; +constexpr auto TN = tera; +constexpr auto PN = peta; +constexpr auto EN = exa; +constexpr auto ZN = zetta; +constexpr auto YN = yotta; +constexpr auto RN = ronna; +constexpr auto QN = quetta; #ifdef pascal #pragma push_macro("pascal") #undef pascal #define MP_UNITS_REDEFINE_PASCAL #endif -inline constexpr auto qPa = quecto; -inline constexpr auto rPa = ronto; -inline constexpr auto yPa = yocto; -inline constexpr auto zPa = zepto; -inline constexpr auto aPa = atto; -inline constexpr auto fPa = femto; -inline constexpr auto pPa = pico; -inline constexpr auto nPa = nano; -inline constexpr auto uPa = micro; -inline constexpr auto mPa = milli; -inline constexpr auto cPa = centi; -inline constexpr auto dPa = deci; -inline constexpr auto Pa = pascal; -inline constexpr auto daPa = deca; -inline constexpr auto hPa = hecto; -inline constexpr auto kPa = kilo; -inline constexpr auto MPa = mega; -inline constexpr auto GPa = giga; -inline constexpr auto TPa = tera; -inline constexpr auto PPa = peta; -inline constexpr auto EPa = exa; -inline constexpr auto ZPa = zetta; -inline constexpr auto YPa = yotta; -inline constexpr auto RPa = ronna; -inline constexpr auto QPa = quetta; +constexpr auto qPa = quecto; +constexpr auto rPa = ronto; +constexpr auto yPa = yocto; +constexpr auto zPa = zepto; +constexpr auto aPa = atto; +constexpr auto fPa = femto; +constexpr auto pPa = pico; +constexpr auto nPa = nano; +constexpr auto uPa = micro; +constexpr auto mPa = milli; +constexpr auto cPa = centi; +constexpr auto dPa = deci; +constexpr auto Pa = pascal; +constexpr auto daPa = deca; +constexpr auto hPa = hecto; +constexpr auto kPa = kilo; +constexpr auto MPa = mega; +constexpr auto GPa = giga; +constexpr auto TPa = tera; +constexpr auto PPa = peta; +constexpr auto EPa = exa; +constexpr auto ZPa = zetta; +constexpr auto YPa = yotta; +constexpr auto RPa = ronna; +constexpr auto QPa = quetta; #ifdef MP_UNITS_REDEFINE_PASCAL #pragma pop_macro("pascal") #undef MP_UNITS_REDEFINE_PASCAL #endif -inline constexpr auto qJ = quecto; -inline constexpr auto rJ = ronto; -inline constexpr auto yJ = yocto; -inline constexpr auto zJ = zepto; -inline constexpr auto aJ = atto; -inline constexpr auto fJ = femto; -inline constexpr auto pJ = pico; -inline constexpr auto nJ = nano; -inline constexpr auto uJ = micro; -inline constexpr auto mJ = milli; -inline constexpr auto cJ = centi; -inline constexpr auto dJ = deci; -inline constexpr auto J = joule; -inline constexpr auto daJ = deca; -inline constexpr auto hJ = hecto; -inline constexpr auto kJ = kilo; -inline constexpr auto MJ = mega; -inline constexpr auto GJ = giga; -inline constexpr auto TJ = tera; -inline constexpr auto PJ = peta; -inline constexpr auto EJ = exa; -inline constexpr auto ZJ = zetta; -inline constexpr auto YJ = yotta; -inline constexpr auto RJ = ronna; -inline constexpr auto QJ = quetta; +constexpr auto qJ = quecto; +constexpr auto rJ = ronto; +constexpr auto yJ = yocto; +constexpr auto zJ = zepto; +constexpr auto aJ = atto; +constexpr auto fJ = femto; +constexpr auto pJ = pico; +constexpr auto nJ = nano; +constexpr auto uJ = micro; +constexpr auto mJ = milli; +constexpr auto cJ = centi; +constexpr auto dJ = deci; +constexpr auto J = joule; +constexpr auto daJ = deca; +constexpr auto hJ = hecto; +constexpr auto kJ = kilo; +constexpr auto MJ = mega; +constexpr auto GJ = giga; +constexpr auto TJ = tera; +constexpr auto PJ = peta; +constexpr auto EJ = exa; +constexpr auto ZJ = zetta; +constexpr auto YJ = yotta; +constexpr auto RJ = ronna; +constexpr auto QJ = quetta; -inline constexpr auto qW = quecto; -inline constexpr auto rW = ronto; -inline constexpr auto yW = yocto; -inline constexpr auto zW = zepto; -inline constexpr auto aW = atto; -inline constexpr auto fW = femto; -inline constexpr auto pW = pico; -inline constexpr auto nW = nano; -inline constexpr auto uW = micro; -inline constexpr auto mW = milli; -inline constexpr auto cW = centi; -inline constexpr auto dW = deci; -inline constexpr auto W = watt; -inline constexpr auto daW = deca; -inline constexpr auto hW = hecto; -inline constexpr auto kW = kilo; -inline constexpr auto MW = mega; -inline constexpr auto GW = giga; -inline constexpr auto TW = tera; -inline constexpr auto PW = peta; -inline constexpr auto EW = exa; -inline constexpr auto ZW = zetta; -inline constexpr auto YW = yotta; -inline constexpr auto RW = ronna; -inline constexpr auto QW = quetta; +constexpr auto qW = quecto; +constexpr auto rW = ronto; +constexpr auto yW = yocto; +constexpr auto zW = zepto; +constexpr auto aW = atto; +constexpr auto fW = femto; +constexpr auto pW = pico; +constexpr auto nW = nano; +constexpr auto uW = micro; +constexpr auto mW = milli; +constexpr auto cW = centi; +constexpr auto dW = deci; +constexpr auto W = watt; +constexpr auto daW = deca; +constexpr auto hW = hecto; +constexpr auto kW = kilo; +constexpr auto MW = mega; +constexpr auto GW = giga; +constexpr auto TW = tera; +constexpr auto PW = peta; +constexpr auto EW = exa; +constexpr auto ZW = zetta; +constexpr auto YW = yotta; +constexpr auto RW = ronna; +constexpr auto QW = quetta; -inline constexpr auto qC = quecto; -inline constexpr auto rC = ronto; -inline constexpr auto yC = yocto; -inline constexpr auto zC = zepto; -inline constexpr auto aC = atto; -inline constexpr auto fC = femto; -inline constexpr auto pC = pico; -inline constexpr auto nC = nano; -inline constexpr auto uC = micro; -inline constexpr auto mC = milli; -inline constexpr auto cC = centi; -inline constexpr auto dC = deci; -inline constexpr auto C = coulomb; -inline constexpr auto daC = deca; -inline constexpr auto hC = hecto; -inline constexpr auto kC = kilo; -inline constexpr auto MC = mega; -inline constexpr auto GC = giga; -inline constexpr auto TC = tera; -inline constexpr auto PC = peta; -inline constexpr auto EC = exa; -inline constexpr auto ZC = zetta; -inline constexpr auto YC = yotta; -inline constexpr auto RC = ronna; -inline constexpr auto QC = quetta; +constexpr auto qC = quecto; +constexpr auto rC = ronto; +constexpr auto yC = yocto; +constexpr auto zC = zepto; +constexpr auto aC = atto; +constexpr auto fC = femto; +constexpr auto pC = pico; +constexpr auto nC = nano; +constexpr auto uC = micro; +constexpr auto mC = milli; +constexpr auto cC = centi; +constexpr auto dC = deci; +constexpr auto C = coulomb; +constexpr auto daC = deca; +constexpr auto hC = hecto; +constexpr auto kC = kilo; +constexpr auto MC = mega; +constexpr auto GC = giga; +constexpr auto TC = tera; +constexpr auto PC = peta; +constexpr auto EC = exa; +constexpr auto ZC = zetta; +constexpr auto YC = yotta; +constexpr auto RC = ronna; +constexpr auto QC = quetta; -inline constexpr auto qV = quecto; -inline constexpr auto rV = ronto; -inline constexpr auto yV = yocto; -inline constexpr auto zV = zepto; -inline constexpr auto aV = atto; -inline constexpr auto fV = femto; -inline constexpr auto pV = pico; -inline constexpr auto nV = nano; -inline constexpr auto uV = micro; -inline constexpr auto mV = milli; -inline constexpr auto cV = centi; -inline constexpr auto dV = deci; -inline constexpr auto V = volt; -inline constexpr auto daV = deca; -inline constexpr auto hV = hecto; -inline constexpr auto kV = kilo; -inline constexpr auto MV = mega; -inline constexpr auto GV = giga; -inline constexpr auto TV = tera; -inline constexpr auto PV = peta; -inline constexpr auto EV = exa; -inline constexpr auto ZV = zetta; -inline constexpr auto YV = yotta; -inline constexpr auto RV = ronna; -inline constexpr auto QV = quetta; +constexpr auto qV = quecto; +constexpr auto rV = ronto; +constexpr auto yV = yocto; +constexpr auto zV = zepto; +constexpr auto aV = atto; +constexpr auto fV = femto; +constexpr auto pV = pico; +constexpr auto nV = nano; +constexpr auto uV = micro; +constexpr auto mV = milli; +constexpr auto cV = centi; +constexpr auto dV = deci; +constexpr auto V = volt; +constexpr auto daV = deca; +constexpr auto hV = hecto; +constexpr auto kV = kilo; +constexpr auto MV = mega; +constexpr auto GV = giga; +constexpr auto TV = tera; +constexpr auto PV = peta; +constexpr auto EV = exa; +constexpr auto ZV = zetta; +constexpr auto YV = yotta; +constexpr auto RV = ronna; +constexpr auto QV = quetta; -inline constexpr auto qF = quecto; -inline constexpr auto rF = ronto; -inline constexpr auto yF = yocto; -inline constexpr auto zF = zepto; -inline constexpr auto aF = atto; -inline constexpr auto fF = femto; -inline constexpr auto pF = pico; -inline constexpr auto nF = nano; -inline constexpr auto uF = micro; -inline constexpr auto mF = milli; -inline constexpr auto cF = centi; -inline constexpr auto dF = deci; -inline constexpr auto F = farad; -inline constexpr auto daF = deca; -inline constexpr auto hF = hecto; -inline constexpr auto kF = kilo; -inline constexpr auto MF = mega; -inline constexpr auto GF = giga; -inline constexpr auto TF = tera; -inline constexpr auto PF = peta; -inline constexpr auto EF = exa; -inline constexpr auto ZF = zetta; -inline constexpr auto YF = yotta; -inline constexpr auto RF = ronna; -inline constexpr auto QF = quetta; +constexpr auto qF = quecto; +constexpr auto rF = ronto; +constexpr auto yF = yocto; +constexpr auto zF = zepto; +constexpr auto aF = atto; +constexpr auto fF = femto; +constexpr auto pF = pico; +constexpr auto nF = nano; +constexpr auto uF = micro; +constexpr auto mF = milli; +constexpr auto cF = centi; +constexpr auto dF = deci; +constexpr auto F = farad; +constexpr auto daF = deca; +constexpr auto hF = hecto; +constexpr auto kF = kilo; +constexpr auto MF = mega; +constexpr auto GF = giga; +constexpr auto TF = tera; +constexpr auto PF = peta; +constexpr auto EF = exa; +constexpr auto ZF = zetta; +constexpr auto YF = yotta; +constexpr auto RF = ronna; +constexpr auto QF = quetta; -inline constexpr auto qohm = quecto; -inline constexpr auto rohm = ronto; -inline constexpr auto yohm = yocto; -inline constexpr auto zohm = zepto; -inline constexpr auto aohm = atto; -inline constexpr auto fohm = femto; -inline constexpr auto pohm = pico; -inline constexpr auto nohm = nano; -inline constexpr auto uohm = micro; -inline constexpr auto mohm = milli; -inline constexpr auto cohm = centi; -inline constexpr auto dohm = deci; +constexpr auto qohm = quecto; +constexpr auto rohm = ronto; +constexpr auto yohm = yocto; +constexpr auto zohm = zepto; +constexpr auto aohm = atto; +constexpr auto fohm = femto; +constexpr auto pohm = pico; +constexpr auto nohm = nano; +constexpr auto uohm = micro; +constexpr auto mohm = milli; +constexpr auto cohm = centi; +constexpr auto dohm = deci; using si::ohm; -inline constexpr auto daohm = deca; -inline constexpr auto hohm = hecto; -inline constexpr auto kohm = kilo; -inline constexpr auto Mohm = mega; -inline constexpr auto Gohm = giga; -inline constexpr auto Tohm = tera; -inline constexpr auto Pohm = peta; -inline constexpr auto Eohm = exa; -inline constexpr auto Zohm = zetta; -inline constexpr auto Yohm = yotta; -inline constexpr auto Rohm = ronna; -inline constexpr auto Qohm = quetta; +constexpr auto daohm = deca; +constexpr auto hohm = hecto; +constexpr auto kohm = kilo; +constexpr auto Mohm = mega; +constexpr auto Gohm = giga; +constexpr auto Tohm = tera; +constexpr auto Pohm = peta; +constexpr auto Eohm = exa; +constexpr auto Zohm = zetta; +constexpr auto Yohm = yotta; +constexpr auto Rohm = ronna; +constexpr auto Qohm = quetta; -inline constexpr auto qS = quecto; -inline constexpr auto rS = ronto; -inline constexpr auto yS = yocto; -inline constexpr auto zS = zepto; -inline constexpr auto aS = atto; -inline constexpr auto fS = femto; -inline constexpr auto pS = pico; -inline constexpr auto nS = nano; -inline constexpr auto uS = micro; -inline constexpr auto mS = milli; -inline constexpr auto cS = centi; -inline constexpr auto dS = deci; -inline constexpr auto S = siemens; -inline constexpr auto daS = deca; -inline constexpr auto hS = hecto; -inline constexpr auto kS = kilo; -inline constexpr auto MS = mega; -inline constexpr auto GS = giga; -inline constexpr auto TS = tera; -inline constexpr auto PS = peta; -inline constexpr auto ES = exa; -inline constexpr auto ZS = zetta; -inline constexpr auto YS = yotta; -inline constexpr auto RS = ronna; -inline constexpr auto QS = quetta; +constexpr auto qS = quecto; +constexpr auto rS = ronto; +constexpr auto yS = yocto; +constexpr auto zS = zepto; +constexpr auto aS = atto; +constexpr auto fS = femto; +constexpr auto pS = pico; +constexpr auto nS = nano; +constexpr auto uS = micro; +constexpr auto mS = milli; +constexpr auto cS = centi; +constexpr auto dS = deci; +constexpr auto S = siemens; +constexpr auto daS = deca; +constexpr auto hS = hecto; +constexpr auto kS = kilo; +constexpr auto MS = mega; +constexpr auto GS = giga; +constexpr auto TS = tera; +constexpr auto PS = peta; +constexpr auto ES = exa; +constexpr auto ZS = zetta; +constexpr auto YS = yotta; +constexpr auto RS = ronna; +constexpr auto QS = quetta; -inline constexpr auto qWb = quecto; -inline constexpr auto rWb = ronto; -inline constexpr auto yWb = yocto; -inline constexpr auto zWb = zepto; -inline constexpr auto aWb = atto; -inline constexpr auto fWb = femto; -inline constexpr auto pWb = pico; -inline constexpr auto nWb = nano; -inline constexpr auto uWb = micro; -inline constexpr auto mWb = milli; -inline constexpr auto cWb = centi; -inline constexpr auto dWb = deci; -inline constexpr auto Wb = weber; -inline constexpr auto daWb = deca; -inline constexpr auto hWb = hecto; -inline constexpr auto kWb = kilo; -inline constexpr auto MWb = mega; -inline constexpr auto GWb = giga; -inline constexpr auto TWb = tera; -inline constexpr auto PWb = peta; -inline constexpr auto EWb = exa; -inline constexpr auto ZWb = zetta; -inline constexpr auto YWb = yotta; -inline constexpr auto RWb = ronna; -inline constexpr auto QWb = quetta; +constexpr auto qWb = quecto; +constexpr auto rWb = ronto; +constexpr auto yWb = yocto; +constexpr auto zWb = zepto; +constexpr auto aWb = atto; +constexpr auto fWb = femto; +constexpr auto pWb = pico; +constexpr auto nWb = nano; +constexpr auto uWb = micro; +constexpr auto mWb = milli; +constexpr auto cWb = centi; +constexpr auto dWb = deci; +constexpr auto Wb = weber; +constexpr auto daWb = deca; +constexpr auto hWb = hecto; +constexpr auto kWb = kilo; +constexpr auto MWb = mega; +constexpr auto GWb = giga; +constexpr auto TWb = tera; +constexpr auto PWb = peta; +constexpr auto EWb = exa; +constexpr auto ZWb = zetta; +constexpr auto YWb = yotta; +constexpr auto RWb = ronna; +constexpr auto QWb = quetta; -inline constexpr auto qT = quecto; -inline constexpr auto rT = ronto; -inline constexpr auto yT = yocto; -inline constexpr auto zT = zepto; -inline constexpr auto aT = atto; -inline constexpr auto fT = femto; -inline constexpr auto pT = pico; -inline constexpr auto nT = nano; -inline constexpr auto uT = micro; -inline constexpr auto mT = milli; -inline constexpr auto cT = centi; -inline constexpr auto dT = deci; -inline constexpr auto T = tesla; -inline constexpr auto daT = deca; -inline constexpr auto hT = hecto; -inline constexpr auto kT = kilo; -inline constexpr auto MT = mega; -inline constexpr auto GT = giga; -inline constexpr auto TT = tera; -inline constexpr auto PT = peta; -inline constexpr auto ET = exa; -inline constexpr auto ZT = zetta; -inline constexpr auto YT = yotta; -inline constexpr auto RT = ronna; -inline constexpr auto QT = quetta; +constexpr auto qT = quecto; +constexpr auto rT = ronto; +constexpr auto yT = yocto; +constexpr auto zT = zepto; +constexpr auto aT = atto; +constexpr auto fT = femto; +constexpr auto pT = pico; +constexpr auto nT = nano; +constexpr auto uT = micro; +constexpr auto mT = milli; +constexpr auto cT = centi; +constexpr auto dT = deci; +constexpr auto T = tesla; +constexpr auto daT = deca; +constexpr auto hT = hecto; +constexpr auto kT = kilo; +constexpr auto MT = mega; +constexpr auto GT = giga; +constexpr auto TT = tera; +constexpr auto PT = peta; +constexpr auto ET = exa; +constexpr auto ZT = zetta; +constexpr auto YT = yotta; +constexpr auto RT = ronna; +constexpr auto QT = quetta; -inline constexpr auto qH = quecto; -inline constexpr auto rH = ronto; -inline constexpr auto yH = yocto; -inline constexpr auto zH = zepto; -inline constexpr auto aH = atto; -inline constexpr auto fH = femto; -inline constexpr auto pH = pico; -inline constexpr auto nH = nano; -inline constexpr auto uH = micro; -inline constexpr auto mH = milli; -inline constexpr auto cH = centi; -inline constexpr auto dH = deci; -inline constexpr auto H = henry; -inline constexpr auto daH = deca; -inline constexpr auto hH = hecto; -inline constexpr auto kH = kilo; -inline constexpr auto MH = mega; -inline constexpr auto GH = giga; -inline constexpr auto TH = tera; -inline constexpr auto PH = peta; -inline constexpr auto EH = exa; -inline constexpr auto ZH = zetta; -inline constexpr auto YH = yotta; -inline constexpr auto RH = ronna; -inline constexpr auto QH = quetta; +constexpr auto qH = quecto; +constexpr auto rH = ronto; +constexpr auto yH = yocto; +constexpr auto zH = zepto; +constexpr auto aH = atto; +constexpr auto fH = femto; +constexpr auto pH = pico; +constexpr auto nH = nano; +constexpr auto uH = micro; +constexpr auto mH = milli; +constexpr auto cH = centi; +constexpr auto dH = deci; +constexpr auto H = henry; +constexpr auto daH = deca; +constexpr auto hH = hecto; +constexpr auto kH = kilo; +constexpr auto MH = mega; +constexpr auto GH = giga; +constexpr auto TH = tera; +constexpr auto PH = peta; +constexpr auto EH = exa; +constexpr auto ZH = zetta; +constexpr auto YH = yotta; +constexpr auto RH = ronna; +constexpr auto QH = quetta; -inline constexpr auto qlm = quecto; -inline constexpr auto rlm = ronto; -inline constexpr auto ylm = yocto; -inline constexpr auto zlm = zepto; -inline constexpr auto alm = atto; -inline constexpr auto flm = femto; -inline constexpr auto plm = pico; -inline constexpr auto nlm = nano; -inline constexpr auto ulm = micro; -inline constexpr auto mlm = milli; -inline constexpr auto clm = centi; -inline constexpr auto dlm = deci; -inline constexpr auto lm = lumen; -inline constexpr auto dalm = deca; -inline constexpr auto hlm = hecto; -inline constexpr auto klm = kilo; -inline constexpr auto Mlm = mega; -inline constexpr auto Glm = giga; -inline constexpr auto Tlm = tera; -inline constexpr auto Plm = peta; -inline constexpr auto Elm = exa; -inline constexpr auto Zlm = zetta; -inline constexpr auto Ylm = yotta; -inline constexpr auto Rlm = ronna; -inline constexpr auto Qlm = quetta; +constexpr auto qlm = quecto; +constexpr auto rlm = ronto; +constexpr auto ylm = yocto; +constexpr auto zlm = zepto; +constexpr auto alm = atto; +constexpr auto flm = femto; +constexpr auto plm = pico; +constexpr auto nlm = nano; +constexpr auto ulm = micro; +constexpr auto mlm = milli; +constexpr auto clm = centi; +constexpr auto dlm = deci; +constexpr auto lm = lumen; +constexpr auto dalm = deca; +constexpr auto hlm = hecto; +constexpr auto klm = kilo; +constexpr auto Mlm = mega; +constexpr auto Glm = giga; +constexpr auto Tlm = tera; +constexpr auto Plm = peta; +constexpr auto Elm = exa; +constexpr auto Zlm = zetta; +constexpr auto Ylm = yotta; +constexpr auto Rlm = ronna; +constexpr auto Qlm = quetta; -inline constexpr auto qlx = quecto; -inline constexpr auto rlx = ronto; -inline constexpr auto ylx = yocto; -inline constexpr auto zlx = zepto; -inline constexpr auto alx = atto; -inline constexpr auto flx = femto; -inline constexpr auto plx = pico; -inline constexpr auto nlx = nano; -inline constexpr auto ulx = micro; -inline constexpr auto mlx = milli; -inline constexpr auto clx = centi; -inline constexpr auto dlx = deci; -inline constexpr auto lx = lux; -inline constexpr auto dalx = deca; -inline constexpr auto hlx = hecto; -inline constexpr auto klx = kilo; -inline constexpr auto Mlx = mega; -inline constexpr auto Glx = giga; -inline constexpr auto Tlx = tera; -inline constexpr auto Plx = peta; -inline constexpr auto Elx = exa; -inline constexpr auto Zlx = zetta; -inline constexpr auto Ylx = yotta; -inline constexpr auto Rlx = ronna; -inline constexpr auto Qlx = quetta; +constexpr auto qlx = quecto; +constexpr auto rlx = ronto; +constexpr auto ylx = yocto; +constexpr auto zlx = zepto; +constexpr auto alx = atto; +constexpr auto flx = femto; +constexpr auto plx = pico; +constexpr auto nlx = nano; +constexpr auto ulx = micro; +constexpr auto mlx = milli; +constexpr auto clx = centi; +constexpr auto dlx = deci; +constexpr auto lx = lux; +constexpr auto dalx = deca; +constexpr auto hlx = hecto; +constexpr auto klx = kilo; +constexpr auto Mlx = mega; +constexpr auto Glx = giga; +constexpr auto Tlx = tera; +constexpr auto Plx = peta; +constexpr auto Elx = exa; +constexpr auto Zlx = zetta; +constexpr auto Ylx = yotta; +constexpr auto Rlx = ronna; +constexpr auto Qlx = quetta; -inline constexpr auto qBq = quecto; -inline constexpr auto rBq = ronto; -inline constexpr auto yBq = yocto; -inline constexpr auto zBq = zepto; -inline constexpr auto aBq = atto; -inline constexpr auto fBq = femto; -inline constexpr auto pBq = pico; -inline constexpr auto nBq = nano; -inline constexpr auto uBq = micro; -inline constexpr auto mBq = milli; -inline constexpr auto cBq = centi; -inline constexpr auto dBq = deci; -inline constexpr auto Bq = becquerel; -inline constexpr auto daBq = deca; -inline constexpr auto hBq = hecto; -inline constexpr auto kBq = kilo; -inline constexpr auto MBq = mega; -inline constexpr auto GBq = giga; -inline constexpr auto TBq = tera; -inline constexpr auto PBq = peta; -inline constexpr auto EBq = exa; -inline constexpr auto ZBq = zetta; -inline constexpr auto YBq = yotta; -inline constexpr auto RBq = ronna; -inline constexpr auto QBq = quetta; +constexpr auto qBq = quecto; +constexpr auto rBq = ronto; +constexpr auto yBq = yocto; +constexpr auto zBq = zepto; +constexpr auto aBq = atto; +constexpr auto fBq = femto; +constexpr auto pBq = pico; +constexpr auto nBq = nano; +constexpr auto uBq = micro; +constexpr auto mBq = milli; +constexpr auto cBq = centi; +constexpr auto dBq = deci; +constexpr auto Bq = becquerel; +constexpr auto daBq = deca; +constexpr auto hBq = hecto; +constexpr auto kBq = kilo; +constexpr auto MBq = mega; +constexpr auto GBq = giga; +constexpr auto TBq = tera; +constexpr auto PBq = peta; +constexpr auto EBq = exa; +constexpr auto ZBq = zetta; +constexpr auto YBq = yotta; +constexpr auto RBq = ronna; +constexpr auto QBq = quetta; -inline constexpr auto qGy = quecto; -inline constexpr auto rGy = ronto; -inline constexpr auto yGy = yocto; -inline constexpr auto zGy = zepto; -inline constexpr auto aGy = atto; -inline constexpr auto fGy = femto; -inline constexpr auto pGy = pico; -inline constexpr auto nGy = nano; -inline constexpr auto uGy = micro; -inline constexpr auto mGy = milli; -inline constexpr auto cGy = centi; -inline constexpr auto dGy = deci; -inline constexpr auto Gy = gray; -inline constexpr auto daGy = deca; -inline constexpr auto hGy = hecto; -inline constexpr auto kGy = kilo; -inline constexpr auto MGy = mega; -inline constexpr auto GGy = giga; -inline constexpr auto TGy = tera; -inline constexpr auto PGy = peta; -inline constexpr auto EGy = exa; -inline constexpr auto ZGy = zetta; -inline constexpr auto YGy = yotta; -inline constexpr auto RGy = ronna; -inline constexpr auto QGy = quetta; +constexpr auto qGy = quecto; +constexpr auto rGy = ronto; +constexpr auto yGy = yocto; +constexpr auto zGy = zepto; +constexpr auto aGy = atto; +constexpr auto fGy = femto; +constexpr auto pGy = pico; +constexpr auto nGy = nano; +constexpr auto uGy = micro; +constexpr auto mGy = milli; +constexpr auto cGy = centi; +constexpr auto dGy = deci; +constexpr auto Gy = gray; +constexpr auto daGy = deca; +constexpr auto hGy = hecto; +constexpr auto kGy = kilo; +constexpr auto MGy = mega; +constexpr auto GGy = giga; +constexpr auto TGy = tera; +constexpr auto PGy = peta; +constexpr auto EGy = exa; +constexpr auto ZGy = zetta; +constexpr auto YGy = yotta; +constexpr auto RGy = ronna; +constexpr auto QGy = quetta; -inline constexpr auto qSv = quecto; -inline constexpr auto rSv = ronto; -inline constexpr auto ySv = yocto; -inline constexpr auto zSv = zepto; -inline constexpr auto aSv = atto; -inline constexpr auto fSv = femto; -inline constexpr auto pSv = pico; -inline constexpr auto nSv = nano; -inline constexpr auto uSv = micro; -inline constexpr auto mSv = milli; -inline constexpr auto cSv = centi; -inline constexpr auto dSv = deci; -inline constexpr auto Sv = sievert; -inline constexpr auto daSv = deca; -inline constexpr auto hSv = hecto; -inline constexpr auto kSv = kilo; -inline constexpr auto MSv = mega; -inline constexpr auto GSv = giga; -inline constexpr auto TSv = tera; -inline constexpr auto PSv = peta; -inline constexpr auto ESv = exa; -inline constexpr auto ZSv = zetta; -inline constexpr auto YSv = yotta; -inline constexpr auto RSv = ronna; -inline constexpr auto QSv = quetta; +constexpr auto qSv = quecto; +constexpr auto rSv = ronto; +constexpr auto ySv = yocto; +constexpr auto zSv = zepto; +constexpr auto aSv = atto; +constexpr auto fSv = femto; +constexpr auto pSv = pico; +constexpr auto nSv = nano; +constexpr auto uSv = micro; +constexpr auto mSv = milli; +constexpr auto cSv = centi; +constexpr auto dSv = deci; +constexpr auto Sv = sievert; +constexpr auto daSv = deca; +constexpr auto hSv = hecto; +constexpr auto kSv = kilo; +constexpr auto MSv = mega; +constexpr auto GSv = giga; +constexpr auto TSv = tera; +constexpr auto PSv = peta; +constexpr auto ESv = exa; +constexpr auto ZSv = zetta; +constexpr auto YSv = yotta; +constexpr auto RSv = ronna; +constexpr auto QSv = quetta; -inline constexpr auto qkat = quecto; -inline constexpr auto rkat = ronto; -inline constexpr auto ykat = yocto; -inline constexpr auto zkat = zepto; -inline constexpr auto akat = atto; -inline constexpr auto fkat = femto; -inline constexpr auto pkat = pico; -inline constexpr auto nkat = nano; -inline constexpr auto ukat = micro; -inline constexpr auto mkat = milli; -inline constexpr auto ckat = centi; -inline constexpr auto dkat = deci; -inline constexpr auto kat = katal; -inline constexpr auto dakat = deca; -inline constexpr auto hkat = hecto; -inline constexpr auto kkat = kilo; -inline constexpr auto Mkat = mega; -inline constexpr auto Gkat = giga; -inline constexpr auto Tkat = tera; -inline constexpr auto Pkat = peta; -inline constexpr auto Ekat = exa; -inline constexpr auto Zkat = zetta; -inline constexpr auto Ykat = yotta; -inline constexpr auto Rkat = ronna; -inline constexpr auto Qkat = quetta; +constexpr auto qkat = quecto; +constexpr auto rkat = ronto; +constexpr auto ykat = yocto; +constexpr auto zkat = zepto; +constexpr auto akat = atto; +constexpr auto fkat = femto; +constexpr auto pkat = pico; +constexpr auto nkat = nano; +constexpr auto ukat = micro; +constexpr auto mkat = milli; +constexpr auto ckat = centi; +constexpr auto dkat = deci; +constexpr auto kat = katal; +constexpr auto dakat = deca; +constexpr auto hkat = hecto; +constexpr auto kkat = kilo; +constexpr auto Mkat = mega; +constexpr auto Gkat = giga; +constexpr auto Tkat = tera; +constexpr auto Pkat = peta; +constexpr auto Ekat = exa; +constexpr auto Zkat = zetta; +constexpr auto Ykat = yotta; +constexpr auto Rkat = ronna; +constexpr auto Qkat = quetta; // no prefixes should be provided for the below units -inline constexpr auto deg_C = degree_Celsius; +constexpr auto deg_C = degree_Celsius; // commonly used squared and cubic units -inline constexpr auto m2 = square(metre); -inline constexpr auto m3 = cubic(metre); -inline constexpr auto m4 = pow<4>(metre); -inline constexpr auto s2 = square(second); -inline constexpr auto s3 = cubic(second); +constexpr auto m2 = square(metre); +constexpr auto m3 = cubic(metre); +constexpr auto m4 = pow<4>(metre); +constexpr auto s2 = square(second); +constexpr auto s3 = cubic(second); } // namespace si::unit_symbols namespace non_si::unit_symbols { // TODO Should the following non-SI units have prefixed symbols predefiend as well? -inline constexpr auto au = astronomical_unit; -inline constexpr auto deg = degree; -inline constexpr auto arcmin = arcminute; -inline constexpr auto arcsec = arcsecond; -inline constexpr auto a = are; -inline constexpr auto ha = hectare; -inline constexpr auto l = litre; -inline constexpr auto t = tonne; -inline constexpr auto Da = dalton; -inline constexpr auto eV = electronvolt; +constexpr auto au = astronomical_unit; +constexpr auto deg = degree; +constexpr auto arcmin = arcminute; +constexpr auto arcsec = arcsecond; +constexpr auto a = are; +constexpr auto ha = hectare; +constexpr auto l = litre; +constexpr auto t = tonne; +constexpr auto Da = dalton; +constexpr auto eV = electronvolt; // no prefixes should be provided for the below units -inline constexpr auto min = minute; -inline constexpr auto h = hour; -inline constexpr auto d = day; +constexpr auto min = minute; +constexpr auto h = hour; +constexpr auto d = day; } // namespace non_si::unit_symbols diff --git a/src/systems/include/mp-units/systems/si/units.h b/src/systems/include/mp-units/systems/si/units.h index 4f5efe52..9b464c98 100644 --- a/src/systems/include/mp-units/systems/si/units.h +++ b/src/systems/include/mp-units/systems/si/units.h @@ -39,55 +39,55 @@ namespace si { // clang-format off // base units -inline constexpr struct second final : named_unit<"s", kind_of> {} second; -inline constexpr struct metre final : named_unit<"m", kind_of> {} metre; -inline constexpr struct gram final : named_unit<"g", kind_of> {} gram; -inline constexpr auto kilogram = kilo; -inline constexpr struct ampere final : named_unit<"A", kind_of> {} ampere; +constexpr struct second final : named_unit<"s", kind_of> {} second; +constexpr struct metre final : named_unit<"m", kind_of> {} metre; +constexpr struct gram final : named_unit<"g", kind_of> {} gram; +constexpr auto kilogram = kilo; +constexpr struct ampere final : named_unit<"A", kind_of> {} ampere; -inline constexpr struct absolute_zero final : absolute_point_origin {} absolute_zero; -inline constexpr auto zeroth_kelvin = absolute_zero; -inline constexpr struct kelvin final : named_unit<"K", kind_of, zeroth_kelvin> {} kelvin; +constexpr struct absolute_zero final : absolute_point_origin {} absolute_zero; +constexpr auto zeroth_kelvin = absolute_zero; +constexpr struct kelvin final : named_unit<"K", kind_of, zeroth_kelvin> {} kelvin; -inline constexpr struct mole final : named_unit<"mol", kind_of> {} mole; -inline constexpr struct candela final : named_unit<"cd", kind_of> {} candela; +constexpr struct mole final : named_unit<"mol", kind_of> {} mole; +constexpr struct candela final : named_unit<"cd", kind_of> {} candela; // derived named units -inline constexpr struct radian final : named_unit<"rad", metre / metre, kind_of> {} radian; -inline constexpr struct steradian final : named_unit<"sr", square(metre) / square(metre), kind_of> {} steradian; -inline constexpr struct hertz final : named_unit<"Hz", one / second, kind_of> {} hertz; -inline constexpr struct newton final : named_unit<"N", kilogram * metre / square(second)> {} newton; +constexpr struct radian final : named_unit<"rad", metre / metre, kind_of> {} radian; +constexpr struct steradian final : named_unit<"sr", square(metre) / square(metre), kind_of> {} steradian; +constexpr struct hertz final : named_unit<"Hz", one / second, kind_of> {} hertz; +constexpr struct newton final : named_unit<"N", kilogram * metre / square(second)> {} newton; #ifdef pascal #pragma push_macro("pascal") #undef pascal #define MP_UNITS_REDEFINE_PASCAL #endif -inline constexpr struct pascal final : named_unit<"Pa", newton / square(metre)> {} pascal; +constexpr struct pascal final : named_unit<"Pa", newton / square(metre)> {} pascal; #ifdef MP_UNITS_REDEFINE_PASCAL #pragma pop_macro("pascal") #undef MP_UNITS_REDEFINE_PASCAL #endif -inline constexpr struct joule final : named_unit<"J", newton * metre> {} joule; -inline constexpr struct watt final : named_unit<"W", joule / second> {} watt; -inline constexpr struct coulomb final : named_unit<"C", ampere * second> {} coulomb; -inline constexpr struct volt final : named_unit<"V", watt / ampere> {} volt; -inline constexpr struct farad final : named_unit<"F", coulomb / volt> {} farad; -inline constexpr struct ohm final : named_unit {} ohm; -inline constexpr struct siemens final : named_unit<"S", one / ohm> {} siemens; -inline constexpr struct weber final : named_unit<"Wb", volt * second> {} weber; -inline constexpr struct tesla final : named_unit<"T", weber / square(metre)> {} tesla; -inline constexpr struct henry final : named_unit<"H", weber / ampere> {} henry; +constexpr struct joule final : named_unit<"J", newton * metre> {} joule; +constexpr struct watt final : named_unit<"W", joule / second> {} watt; +constexpr struct coulomb final : named_unit<"C", ampere * second> {} coulomb; +constexpr struct volt final : named_unit<"V", watt / ampere> {} volt; +constexpr struct farad final : named_unit<"F", coulomb / volt> {} farad; +constexpr struct ohm final : named_unit {} ohm; +constexpr struct siemens final : named_unit<"S", one / ohm> {} siemens; +constexpr struct weber final : named_unit<"Wb", volt * second> {} weber; +constexpr struct tesla final : named_unit<"T", weber / square(metre)> {} tesla; +constexpr struct henry final : named_unit<"H", weber / ampere> {} henry; -inline constexpr struct ice_point final : relative_point_origin>(273'150)> {} ice_point; -inline constexpr auto zeroth_degree_Celsius = ice_point; -inline constexpr struct degree_Celsius final : named_unit {} degree_Celsius; +constexpr struct ice_point final : relative_point_origin>(273'150)> {} ice_point; +constexpr auto zeroth_degree_Celsius = ice_point; +constexpr struct degree_Celsius final : named_unit {} degree_Celsius; -inline constexpr struct lumen final : named_unit<"lm", candela * steradian> {} lumen; -inline constexpr struct lux final : named_unit<"lx", lumen / square(metre)> {} lux; -inline constexpr struct becquerel final : named_unit<"Bq", one / second, kind_of> {} becquerel; -inline constexpr struct gray final : named_unit<"Gy", joule / kilogram, kind_of> {} gray; -inline constexpr struct sievert final : named_unit<"Sv", joule / kilogram, kind_of> {} sievert; -inline constexpr struct katal final : named_unit<"kat", mole / second> {} katal; +constexpr struct lumen final : named_unit<"lm", candela * steradian> {} lumen; +constexpr struct lux final : named_unit<"lx", lumen / square(metre)> {} lux; +constexpr struct becquerel final : named_unit<"Bq", one / second, kind_of> {} becquerel; +constexpr struct gray final : named_unit<"Gy", joule / kilogram, kind_of> {} gray; +constexpr struct sievert final : named_unit<"Sv", joule / kilogram, kind_of> {} sievert; +constexpr struct katal final : named_unit<"kat", mole / second> {} katal; // clang-format on } // namespace si @@ -96,20 +96,20 @@ namespace non_si { // clang-format off // non-SI units accepted for use with the SI -inline constexpr struct minute final : named_unit<"min", mag<60> * si::second> {} minute; -inline constexpr struct hour final : named_unit<"h", mag<60> * minute> {} hour; -inline constexpr struct day final : named_unit<"d", mag<24> * hour> {} day; -inline constexpr struct astronomical_unit final : named_unit<"au", mag<149'597'870'700> * si::metre> {} astronomical_unit; -inline constexpr struct degree final : named_unit * si::radian> {} degree; -inline constexpr struct arcminute final : named_unit * degree> {} arcminute; -inline constexpr struct arcsecond final : named_unit * arcminute> {} arcsecond; -inline constexpr struct are final : named_unit<"a", square(si::deca)> {} are; -inline constexpr auto hectare = si::hecto; -inline constexpr struct litre final : named_unit<"l", cubic(si::deci)> {} litre; -inline constexpr struct tonne final : named_unit<"t", mag<1000> * si::kilogram> {} tonne; -inline constexpr struct dalton final : named_unit<"Da", mag_ratio<16'605'390'666'050, 10'000'000'000'000> * mag_power<10, -27> * si::kilogram> {} dalton; +constexpr struct minute final : named_unit<"min", mag<60> * si::second> {} minute; +constexpr struct hour final : named_unit<"h", mag<60> * minute> {} hour; +constexpr struct day final : named_unit<"d", mag<24> * hour> {} day; +constexpr struct astronomical_unit final : named_unit<"au", mag<149'597'870'700> * si::metre> {} astronomical_unit; +constexpr struct degree final : named_unit * si::radian> {} degree; +constexpr struct arcminute final : named_unit * degree> {} arcminute; +constexpr struct arcsecond final : named_unit * arcminute> {} arcsecond; +constexpr struct are final : named_unit<"a", square(si::deca)> {} are; +constexpr auto hectare = si::hecto; +constexpr struct litre final : named_unit<"l", cubic(si::deci)> {} litre; +constexpr struct tonne final : named_unit<"t", mag<1000> * si::kilogram> {} tonne; +constexpr struct dalton final : named_unit<"Da", mag_ratio<16'605'390'666'050, 10'000'000'000'000> * mag_power<10, -27> * si::kilogram> {} dalton; // TODO A different value is provided in the SI Brochure and different in the ISO 80000 -inline constexpr struct electronvolt final : named_unit<"eV", mag_ratio<1'602'176'634, 1'000'000'000> * mag_power<10, -19> * si::joule> {} electronvolt; +constexpr struct electronvolt final : named_unit<"eV", mag_ratio<1'602'176'634, 1'000'000'000> * mag_power<10, -19> * si::joule> {} electronvolt; // TODO the below are logarithmic units - how to support those? // neper // bel @@ -126,10 +126,10 @@ using namespace non_si; } // namespace si template<> -inline constexpr bool space_before_unit_symbol = false; +constexpr bool space_before_unit_symbol = false; template<> -inline constexpr bool space_before_unit_symbol = false; +constexpr bool space_before_unit_symbol = false; template<> -inline constexpr bool space_before_unit_symbol = false; +constexpr bool space_before_unit_symbol = false; } // namespace mp_units diff --git a/src/systems/include/mp-units/systems/typographic.h b/src/systems/include/mp-units/systems/typographic.h index f368d350..6969d594 100644 --- a/src/systems/include/mp-units/systems/typographic.h +++ b/src/systems/include/mp-units/systems/typographic.h @@ -36,11 +36,11 @@ namespace mp_units::typographic { // clang-format off // https://en.wikipedia.org/wiki/Point_(typography) -inline constexpr struct pica_us final : named_unit<"pica(us)", mag_ratio<166'044, 1'000'000> * international::inch> {} pica_us; -inline constexpr struct point_us final : named_unit<"point(us)", mag_ratio<1, 12> * pica_us> {} point_us; +constexpr struct pica_us final : named_unit<"pica(us)", mag_ratio<166'044, 1'000'000> * international::inch> {} pica_us; +constexpr struct point_us final : named_unit<"point(us)", mag_ratio<1, 12> * pica_us> {} point_us; -inline constexpr struct point_dtp final : named_unit<"point(dtp)", mag_ratio<1, 72> * international::inch> {} point_dtp; -inline constexpr struct pica_dtp final : named_unit<"pica(dtp)", mag<12> * point_dtp> {} pica_dtp; +constexpr struct point_dtp final : named_unit<"point(dtp)", mag_ratio<1, 72> * international::inch> {} point_dtp; +constexpr struct pica_dtp final : named_unit<"pica(dtp)", mag<12> * point_dtp> {} pica_dtp; // clang-format on } // namespace mp_units::typographic diff --git a/src/systems/include/mp-units/systems/usc.h b/src/systems/include/mp-units/systems/usc.h index cca91973..8214d7c4 100644 --- a/src/systems/include/mp-units/systems/usc.h +++ b/src/systems/include/mp-units/systems/usc.h @@ -41,78 +41,78 @@ using namespace international; // https://en.wikipedia.org/wiki/United_States_customary_units#Length // nautical -inline constexpr struct fathom final : named_unit<"ftm(us)", mag<2> * yard> {} fathom; -inline constexpr struct cable final : named_unit<"cb(us)", mag<120> * fathom> {} cable; +constexpr struct fathom final : named_unit<"ftm(us)", mag<2> * yard> {} fathom; +constexpr struct cable final : named_unit<"cb(us)", mag<120> * fathom> {} cable; // survey struct us_survey_foot final : named_unit<"ft(us)", mag_ratio<1'200, 3'937> * si::metre> {}; struct us_survey_mile final : named_unit<"mi(us)", mag<5280> * us_survey_foot{}> {}; [[deprecated("In accordance with NIST SP 811, as of January 1, 2023, the use of the U.S. survey foot and U.S. survey mile is deprecated.")]] -inline constexpr us_survey_foot us_survey_foot; +constexpr us_survey_foot us_survey_foot; [[deprecated("In accordance with NIST SP 811, as of January 1, 2023, the use of the U.S. survey foot and U.S. survey mile is deprecated.")]] -inline constexpr us_survey_mile us_survey_mile; +constexpr us_survey_mile us_survey_mile; -inline constexpr struct link final : named_unit<"li", mag_ratio<33, 50> * foot> {} link; -inline constexpr struct rod final : named_unit<"rd", mag<25> * link> {} rod; -inline constexpr struct chain final : named_unit<"ch", mag<4> * rod> {} chain; -inline constexpr struct furlong final : named_unit<"fur", mag<10> * chain> {} furlong; +constexpr struct link final : named_unit<"li", mag_ratio<33, 50> * foot> {} link; +constexpr struct rod final : named_unit<"rd", mag<25> * link> {} rod; +constexpr struct chain final : named_unit<"ch", mag<4> * rod> {} chain; +constexpr struct furlong final : named_unit<"fur", mag<10> * chain> {} furlong; // clang-format on namespace survey1893 { // clang-format off -inline constexpr struct us_survey_foot final : named_unit<"ft(us)", mag_ratio<1'200, 3'937> * si::metre> {} us_survey_foot; -inline constexpr struct link final : named_unit<"li", mag_ratio<33, 50> * us_survey_foot> {} link; -inline constexpr struct rod final : named_unit<"rd", mag<25> * link> {} rod; -inline constexpr struct chain final : named_unit<"ch", mag<4> * rod> {} chain; -inline constexpr struct furlong final : named_unit<"fur", mag<10> * chain> {} furlong; -inline constexpr struct us_survey_mile final : named_unit<"mi(us)", mag<8> * furlong> {} us_survey_mile; -inline constexpr struct league final : named_unit<"lea", mag<3> * us_survey_mile> {} league; +constexpr struct us_survey_foot final : named_unit<"ft(us)", mag_ratio<1'200, 3'937> * si::metre> {} us_survey_foot; +constexpr struct link final : named_unit<"li", mag_ratio<33, 50> * us_survey_foot> {} link; +constexpr struct rod final : named_unit<"rd", mag<25> * link> {} rod; +constexpr struct chain final : named_unit<"ch", mag<4> * rod> {} chain; +constexpr struct furlong final : named_unit<"fur", mag<10> * chain> {} furlong; +constexpr struct us_survey_mile final : named_unit<"mi(us)", mag<8> * furlong> {} us_survey_mile; +constexpr struct league final : named_unit<"lea", mag<3> * us_survey_mile> {} league; // clang-format on } // namespace survey1893 // clang-format off // https://en.wikipedia.org/wiki/United_States_customary_units#Area -inline constexpr struct acre final : named_unit<"acre", mag<10> * square(survey1893::chain)> {} acre; -inline constexpr struct section final : named_unit<"section", mag<640> * acre> {} section; +constexpr struct acre final : named_unit<"acre", mag<10> * square(survey1893::chain)> {} acre; +constexpr struct section final : named_unit<"section", mag<640> * acre> {} section; // https://en.wikipedia.org/wiki/United_States_customary_units#Fluid_volume -inline constexpr struct gallon final : named_unit<"gal", mag<231> * cubic(inch)> {} gallon; -inline constexpr struct pottle final : named_unit<"pot", mag_ratio<1, 2> * gallon> {} pottle; -inline constexpr struct quart final : named_unit<"qt", mag_ratio<1, 2> * pottle> {} quart; -inline constexpr struct pint final : named_unit<"pt", mag_ratio<1, 2> * quart> {} pint; -inline constexpr struct cup final : named_unit<"c", mag_ratio<1, 2> * pint> {} cup; -inline constexpr struct gill final : named_unit<"gi", mag_ratio<1, 2> * cup> {} gill; -inline constexpr struct fluid_ounce final : named_unit<"fl oz", mag_ratio<1, 4> * gill> {} fluid_ounce; -inline constexpr struct tablespoon final : named_unit<"tbsp", mag_ratio<1, 2> * fluid_ounce> {} tablespoon; -inline constexpr struct shot final : named_unit<"jig", mag<3> * tablespoon> {} shot; -inline constexpr struct teaspoon final : named_unit<"tsp", mag_ratio<1, 3> * tablespoon> {} teaspoon; -inline constexpr struct minim final : named_unit<"min", mag_ratio<1, 80> * teaspoon> {} minim; -inline constexpr struct fluid_dram final : named_unit<"fl dr", mag<60> * minim> {} fluid_dram; -inline constexpr struct barrel final : named_unit<"bbl", mag_ratio<315, 10> * gallon> {} barrel; -inline constexpr struct oil_barrel final : named_unit<"bbl", mag_ratio<4, 3> * barrel> {} oil_barrel; -inline constexpr struct hogshead final : named_unit<"hogshead", mag<63> * gallon> {} hogshead; +constexpr struct gallon final : named_unit<"gal", mag<231> * cubic(inch)> {} gallon; +constexpr struct pottle final : named_unit<"pot", mag_ratio<1, 2> * gallon> {} pottle; +constexpr struct quart final : named_unit<"qt", mag_ratio<1, 2> * pottle> {} quart; +constexpr struct pint final : named_unit<"pt", mag_ratio<1, 2> * quart> {} pint; +constexpr struct cup final : named_unit<"c", mag_ratio<1, 2> * pint> {} cup; +constexpr struct gill final : named_unit<"gi", mag_ratio<1, 2> * cup> {} gill; +constexpr struct fluid_ounce final : named_unit<"fl oz", mag_ratio<1, 4> * gill> {} fluid_ounce; +constexpr struct tablespoon final : named_unit<"tbsp", mag_ratio<1, 2> * fluid_ounce> {} tablespoon; +constexpr struct shot final : named_unit<"jig", mag<3> * tablespoon> {} shot; +constexpr struct teaspoon final : named_unit<"tsp", mag_ratio<1, 3> * tablespoon> {} teaspoon; +constexpr struct minim final : named_unit<"min", mag_ratio<1, 80> * teaspoon> {} minim; +constexpr struct fluid_dram final : named_unit<"fl dr", mag<60> * minim> {} fluid_dram; +constexpr struct barrel final : named_unit<"bbl", mag_ratio<315, 10> * gallon> {} barrel; +constexpr struct oil_barrel final : named_unit<"bbl", mag_ratio<4, 3> * barrel> {} oil_barrel; +constexpr struct hogshead final : named_unit<"hogshead", mag<63> * gallon> {} hogshead; // https://en.wikipedia.org/wiki/United_States_customary_units#Dry_volume -inline constexpr struct dry_barrel final : named_unit<"bbl", mag<7056> * cubic(inch)> {} dry_barrel; -inline constexpr struct bushel final : named_unit<"bu", mag_ratio<3'523'907'016'688, 100'000'000'000> * si::litre> {} bushel; -inline constexpr struct peck final : named_unit<"pk", mag_ratio<1, 4> * bushel> {} peck; -inline constexpr struct dry_gallon final : named_unit<"gal", mag_ratio<1, 2> * peck> {} dry_gallon; -inline constexpr struct dry_quart final : named_unit<"qt", mag_ratio<1, 4> * dry_gallon> {} dry_quart; -inline constexpr struct dry_pint final : named_unit<"pt", mag_ratio<1, 2> * dry_quart> {} dry_pint; +constexpr struct dry_barrel final : named_unit<"bbl", mag<7056> * cubic(inch)> {} dry_barrel; +constexpr struct bushel final : named_unit<"bu", mag_ratio<3'523'907'016'688, 100'000'000'000> * si::litre> {} bushel; +constexpr struct peck final : named_unit<"pk", mag_ratio<1, 4> * bushel> {} peck; +constexpr struct dry_gallon final : named_unit<"gal", mag_ratio<1, 2> * peck> {} dry_gallon; +constexpr struct dry_quart final : named_unit<"qt", mag_ratio<1, 4> * dry_gallon> {} dry_quart; +constexpr struct dry_pint final : named_unit<"pt", mag_ratio<1, 2> * dry_quart> {} dry_pint; // https://en.wikipedia.org/wiki/United_States_customary_units#Mass_and_Weight // https://en.wikipedia.org/wiki/Avoirdupois_system#American_customary_system -inline constexpr struct quarter final : named_unit<"qr", mag<25> * pound> {} quarter; -inline constexpr struct short_hundredweight final : named_unit<"cwt", mag<100> * pound> {} short_hundredweight; -inline constexpr struct ton final : named_unit<"t", mag<2'000> * pound> {} ton; -inline constexpr auto short_ton = ton; -inline constexpr struct pennyweight final : named_unit<"dwt", mag<24> * grain> {} pennyweight; -inline constexpr struct troy_once final : named_unit<"oz t", mag<20> * pennyweight> {} troy_once; -inline constexpr struct troy_pound final : named_unit<"lb t", mag<12> * troy_once> {} troy_pound; +constexpr struct quarter final : named_unit<"qr", mag<25> * pound> {} quarter; +constexpr struct short_hundredweight final : named_unit<"cwt", mag<100> * pound> {} short_hundredweight; +constexpr struct ton final : named_unit<"t", mag<2'000> * pound> {} ton; +constexpr auto short_ton = ton; +constexpr struct pennyweight final : named_unit<"dwt", mag<24> * grain> {} pennyweight; +constexpr struct troy_once final : named_unit<"oz t", mag<20> * pennyweight> {} troy_once; +constexpr struct troy_pound final : named_unit<"lb t", mag<12> * troy_once> {} troy_pound; // https://en.wikipedia.org/wiki/Inch_of_mercury #ifdef pascal @@ -120,15 +120,15 @@ inline constexpr struct troy_pound final : named_unit<"lb t", mag<12> * troy_onc #undef pascal #define MP_UNITS_REDEFINE_PASCAL #endif -inline constexpr struct inch_of_mercury final : named_unit<"inHg", mag_ratio<3'386'389, 1'000> * si::pascal> {} inch_of_mercury; +constexpr struct inch_of_mercury final : named_unit<"inHg", mag_ratio<3'386'389, 1'000> * si::pascal> {} inch_of_mercury; #ifdef MP_UNITS_REDEFINE_PASCAL #pragma pop_macro("pascal") #undef MP_UNITS_REDEFINE_PASCAL #endif // https://en.wikipedia.org/wiki/United_States_customary_units#Temperature -inline constexpr struct zeroth_degree_Fahrenheit final : relative_point_origin * si::degree_Celsius>(-32)> {} zeroth_degree_Fahrenheit; -inline constexpr struct degree_Fahrenheit final : named_unit * si::degree_Celsius, zeroth_degree_Fahrenheit> {} degree_Fahrenheit; +constexpr struct zeroth_degree_Fahrenheit final : relative_point_origin * si::degree_Celsius>(-32)> {} zeroth_degree_Fahrenheit; +constexpr struct degree_Fahrenheit final : named_unit * si::degree_Celsius, zeroth_degree_Fahrenheit> {} degree_Fahrenheit; // clang-format on @@ -136,51 +136,51 @@ namespace unit_symbols { using namespace international::unit_symbols; -inline constexpr auto ftm = fathom; -inline constexpr auto cb = cable; +constexpr auto ftm = fathom; +constexpr auto cb = cable; [[deprecated( "In accordance with NIST SP 811, as of January 1, 2023, the use of the U.S. survey foot and U.S. survey mile is " - "deprecated.")]] inline constexpr struct us_survey_foot us_ft; + "deprecated.")]] constexpr struct us_survey_foot us_ft; [[deprecated( "In accordance with NIST SP 811, as of January 1, 2023, the use of the U.S. survey foot and U.S. survey mile is " - "deprecated.")]] inline constexpr struct us_survey_mile us_mi; -inline constexpr auto li = link; -inline constexpr auto rd = rod; -inline constexpr auto ch = chain; -inline constexpr auto fur = furlong; -inline constexpr auto lea = league; + "deprecated.")]] constexpr struct us_survey_mile us_mi; +constexpr auto li = link; +constexpr auto rd = rod; +constexpr auto ch = chain; +constexpr auto fur = furlong; +constexpr auto lea = league; -inline constexpr auto gal = gallon; -inline constexpr auto pot = pottle; -inline constexpr auto qt = quart; -inline constexpr auto pt = pint; -inline constexpr auto c = cup; -inline constexpr auto gi = gill; -inline constexpr auto fl_oz = fluid_ounce; -inline constexpr auto tbsp = tablespoon; -inline constexpr auto jig = shot; -inline constexpr auto tsp = teaspoon; -inline constexpr auto min = minim; -inline constexpr auto fl_dr = fluid_dram; -inline constexpr auto bbl = barrel; +constexpr auto gal = gallon; +constexpr auto pot = pottle; +constexpr auto qt = quart; +constexpr auto pt = pint; +constexpr auto c = cup; +constexpr auto gi = gill; +constexpr auto fl_oz = fluid_ounce; +constexpr auto tbsp = tablespoon; +constexpr auto jig = shot; +constexpr auto tsp = teaspoon; +constexpr auto min = minim; +constexpr auto fl_dr = fluid_dram; +constexpr auto bbl = barrel; -inline constexpr auto dry_bbl = dry_barrel; -inline constexpr auto bu = bushel; -inline constexpr auto pk = peck; -inline constexpr auto dry_gal = dry_gallon; -inline constexpr auto dry_qt = dry_quart; -inline constexpr auto dry_pt = dry_pint; +constexpr auto dry_bbl = dry_barrel; +constexpr auto bu = bushel; +constexpr auto pk = peck; +constexpr auto dry_gal = dry_gallon; +constexpr auto dry_qt = dry_quart; +constexpr auto dry_pt = dry_pint; -inline constexpr auto qr = quarter; -inline constexpr auto cwt = short_hundredweight; -inline constexpr auto t = ton; -inline constexpr auto dwt = pennyweight; -inline constexpr auto oz_t = troy_once; -inline constexpr auto lb_t = troy_pound; +constexpr auto qr = quarter; +constexpr auto cwt = short_hundredweight; +constexpr auto t = ton; +constexpr auto dwt = pennyweight; +constexpr auto oz_t = troy_once; +constexpr auto lb_t = troy_pound; -inline constexpr auto inHg = inch_of_mercury; +constexpr auto inHg = inch_of_mercury; -inline constexpr auto deg_F = degree_Fahrenheit; +constexpr auto deg_F = degree_Fahrenheit; } // namespace unit_symbols diff --git a/test/runtime/fmt_test.cpp b/test/runtime/fmt_test.cpp index 7df94d90..5cf76786 100644 --- a/test/runtime/fmt_test.cpp +++ b/test/runtime/fmt_test.cpp @@ -50,7 +50,7 @@ import mp_units; template requires mp_units::is_scalar -inline constexpr bool mp_units::is_vector = true; +constexpr bool mp_units::is_vector = true; using namespace mp_units; using namespace mp_units::si::unit_symbols; diff --git a/test/runtime/linear_algebra_test.cpp b/test/runtime/linear_algebra_test.cpp index 0a8e8ef7..4799decd 100644 --- a/test/runtime/linear_algebra_test.cpp +++ b/test/runtime/linear_algebra_test.cpp @@ -44,10 +44,10 @@ template using vector = STD_LA::fixed_size_column_vector; template -inline constexpr bool mp_units::treat_as_floating_point> = mp_units::treat_as_floating_point; +constexpr bool mp_units::treat_as_floating_point> = mp_units::treat_as_floating_point; template -inline constexpr bool mp_units::is_vector> = true; +constexpr bool mp_units::is_vector> = true; template std::ostream& operator<<(std::ostream& os, const vector& v) @@ -301,7 +301,7 @@ TEST_CASE("vector quantity", "[la]") template requires mp_units::is_scalar -inline constexpr bool mp_units::is_vector = true; +constexpr bool mp_units::is_vector = true; TEST_CASE("vector of quantities", "[la]") { diff --git a/test/runtime/truncation_test.cpp b/test/runtime/truncation_test.cpp index 3ff10046..2626c583 100644 --- a/test/runtime/truncation_test.cpp +++ b/test/runtime/truncation_test.cpp @@ -42,9 +42,9 @@ using namespace mp_units; using namespace mp_units::angular; using namespace mp_units::angular::unit_symbols; -inline constexpr struct half_revolution final : named_unit<"hrev", mag_pi * radian> { +constexpr struct half_revolution final : named_unit<"hrev", mag_pi * radian> { } half_revolution; -inline constexpr auto hrev = half_revolution; +constexpr auto hrev = half_revolution; // constexpr auto revb6 = mag_ratio<1,3> * mag_pi * rad; diff --git a/test/static/cgs_test.cpp b/test/static/cgs_test.cpp index 557a8f7a..c027b601 100644 --- a/test/static/cgs_test.cpp +++ b/test/static/cgs_test.cpp @@ -28,7 +28,7 @@ template requires mp_units::is_scalar -inline constexpr bool mp_units::is_vector = true; +constexpr bool mp_units::is_vector = true; namespace { diff --git a/test/static/concepts_test.cpp b/test/static/concepts_test.cpp index 06b20699..937776eb 100644 --- a/test/static/concepts_test.cpp +++ b/test/static/concepts_test.cpp @@ -37,19 +37,19 @@ import std; #if MP_UNITS_HOSTED template -inline constexpr bool mp_units::is_scalar> = true; +constexpr bool mp_units::is_scalar> = true; #endif namespace { using namespace mp_units; -inline constexpr struct my_origin final : absolute_point_origin { +constexpr struct my_origin final : absolute_point_origin { } my_origin; -inline constexpr struct my_relative_origin final : relative_point_origin { +constexpr struct my_relative_origin final : relative_point_origin { } my_relative_origin; -inline constexpr auto dim_speed = isq::dim_length / isq::dim_time; +constexpr auto dim_speed = isq::dim_length / isq::dim_time; // BaseDimension static_assert(detail::BaseDimension); @@ -78,7 +78,7 @@ static_assert(!Dimension); // TODO add tests // QuantitySpec -inline constexpr auto speed = isq::length / isq::time; +constexpr auto speed = isq::length / isq::time; static_assert(QuantitySpec); static_assert(QuantitySpec); diff --git a/test/static/custom_rep_test_min_impl.cpp b/test/static/custom_rep_test_min_impl.cpp index 8e8c3b7c..4fb2537b 100644 --- a/test/static/custom_rep_test_min_impl.cpp +++ b/test/static/custom_rep_test_min_impl.cpp @@ -61,7 +61,7 @@ public: } // namespace template -inline constexpr bool mp_units::is_scalar> = true; +constexpr bool mp_units::is_scalar> = true; template struct std::common_type, min_impl> : std::type_identity>> {}; diff --git a/test/static/dimension_test.cpp b/test/static/dimension_test.cpp index 8064831e..6d4aa96f 100644 --- a/test/static/dimension_test.cpp +++ b/test/static/dimension_test.cpp @@ -36,31 +36,31 @@ using namespace mp_units; using dimension_one_ = struct dimension_one; // clang-format off -inline constexpr struct length_ final : base_dimension<"L"> {} length; -inline constexpr struct mass_ final : base_dimension<"M"> {} mass; -inline constexpr struct time_ final : base_dimension<"T"> {} time; +constexpr struct length_ final : base_dimension<"L"> {} length; +constexpr struct mass_ final : base_dimension<"M"> {} mass; +constexpr struct time_ final : base_dimension<"T"> {} time; -inline constexpr auto my_length1 = length; -inline constexpr auto my_length2 = length; +constexpr auto my_length1 = length; +constexpr auto my_length2 = length; QUANTITY_SPEC_(q_time, time); -inline constexpr struct second_ final : named_unit<"s", kind_of> {} second; +constexpr struct second_ final : named_unit<"s", kind_of> {} second; -inline constexpr auto frequency = inverse(time); -inline constexpr auto action = inverse(time); -inline constexpr auto area = length * length; -inline constexpr auto volume = area * length; -inline constexpr auto speed = length / time; -inline constexpr auto acceleration = speed / time; -inline constexpr auto force = mass * acceleration; -inline constexpr auto moment_of_force = length * force; -inline constexpr auto torque = moment_of_force; -inline constexpr auto pressure = force / area; -inline constexpr auto stress = pressure; -inline constexpr auto strain = stress / stress; -inline constexpr auto power = force * speed; -inline constexpr auto efficiency = power / power; -inline constexpr auto energy = force * length; +constexpr auto frequency = inverse(time); +constexpr auto action = inverse(time); +constexpr auto area = length * length; +constexpr auto volume = area * length; +constexpr auto speed = length / time; +constexpr auto acceleration = speed / time; +constexpr auto force = mass * acceleration; +constexpr auto moment_of_force = length * force; +constexpr auto torque = moment_of_force; +constexpr auto pressure = force / area; +constexpr auto stress = pressure; +constexpr auto strain = stress / stress; +constexpr auto power = force * speed; +constexpr auto efficiency = power / power; +constexpr auto energy = force * length; // clang-format on // concepts verification diff --git a/test/static/hep_test.cpp b/test/static/hep_test.cpp index 20316774..62407bd4 100644 --- a/test/static/hep_test.cpp +++ b/test/static/hep_test.cpp @@ -26,7 +26,7 @@ template requires mp_units::is_scalar -inline constexpr bool mp_units::is_vector = true; +constexpr bool mp_units::is_vector = true; namespace { diff --git a/test/static/international_test.cpp b/test/static/international_test.cpp index 8dc41168..755eea73 100644 --- a/test/static/international_test.cpp +++ b/test/static/international_test.cpp @@ -28,7 +28,7 @@ template requires mp_units::is_scalar -inline constexpr bool mp_units::is_vector = true; +constexpr bool mp_units::is_vector = true; namespace { diff --git a/test/static/magnitude_test.cpp b/test/static/magnitude_test.cpp index f245b0b8..da2dd5cb 100644 --- a/test/static/magnitude_test.cpp +++ b/test/static/magnitude_test.cpp @@ -32,7 +32,7 @@ using namespace units; using namespace units::detail; template<> -inline constexpr std::optional units::known_first_factor<9223372036854775783> = 9223372036854775783; +constexpr std::optional units::known_first_factor<9223372036854775783> = 9223372036854775783; namespace { @@ -71,11 +71,11 @@ namespace { // CHECK(round_trip == R); // } -inline constexpr struct mag_2_ : magnitude<2> { +constexpr struct mag_2_ : magnitude<2> { } mag_2; -// inline constexpr struct mag_2_other : magnitude<2> { +// constexpr struct mag_2_other : magnitude<2> { // } mag_2_other; -// inline constexpr struct mag_3 : magnitude<2> { +// constexpr struct mag_3 : magnitude<2> { // } mag_3; // concepts verification diff --git a/test/static/natural_test.cpp b/test/static/natural_test.cpp index 84e61e9e..9986149a 100644 --- a/test/static/natural_test.cpp +++ b/test/static/natural_test.cpp @@ -24,7 +24,7 @@ template requires mp_units::is_scalar -inline constexpr bool mp_units::is_vector = true; +constexpr bool mp_units::is_vector = true; namespace { diff --git a/test/static/quantity_point_test.cpp b/test/static/quantity_point_test.cpp index 06ad1f16..80a35127 100644 --- a/test/static/quantity_point_test.cpp +++ b/test/static/quantity_point_test.cpp @@ -50,38 +50,38 @@ using namespace std::chrono_literals; using sys_seconds = std::chrono::time_point; #endif -inline constexpr struct zeroth_length final : absolute_point_origin { +constexpr struct zeroth_length final : absolute_point_origin { } zeroth_length; -inline constexpr struct mean_sea_level final : absolute_point_origin { +constexpr struct mean_sea_level final : absolute_point_origin { } mean_sea_level; -inline constexpr auto my_mean_sea_level = mean_sea_level; +constexpr auto my_mean_sea_level = mean_sea_level; -inline constexpr struct same_mean_sea_level final : relative_point_origin { +constexpr struct same_mean_sea_level final : relative_point_origin { } same_mean_sea_level; -inline constexpr struct ground_level final : relative_point_origin { +constexpr struct ground_level final : relative_point_origin { } ground_level; -inline constexpr auto my_ground_level = ground_level; +constexpr auto my_ground_level = ground_level; -inline constexpr struct same_ground_level1 final : relative_point_origin { +constexpr struct same_ground_level1 final : relative_point_origin { } same_ground_level1; -inline constexpr struct same_ground_level2 final : relative_point_origin { +constexpr struct same_ground_level2 final : relative_point_origin { } same_ground_level2; -inline constexpr struct tower_peak final : relative_point_origin { +constexpr struct tower_peak final : relative_point_origin { } tower_peak; -inline constexpr struct other_ground_level final : relative_point_origin { +constexpr struct other_ground_level final : relative_point_origin { } other_ground_level; -inline constexpr struct other_absolute_level final : absolute_point_origin { +constexpr struct other_absolute_level final : absolute_point_origin { } other_absolute_level; -inline constexpr struct zero final : absolute_point_origin { +constexpr struct zero final : absolute_point_origin { } zero; QUANTITY_SPEC(special_height, isq::height); @@ -111,18 +111,18 @@ static_assert(ground_level != other_ground_level); template struct absolute_po_ final : absolute_point_origin {}; template -inline constexpr absolute_po_ absolute_po; +constexpr absolute_po_ absolute_po; template struct relative_po_ final : relative_point_origin {}; template -inline constexpr relative_po_ relative_po; +constexpr relative_po_ relative_po; static_assert(relative_po + isq::height(42 * m)>.quantity_spec == isq::height); static_assert(relative_po> + isq::height(42 * m)>.quantity_spec == isq::height); static_assert(relative_po + 42 * m>.quantity_spec == isq::height); -inline constexpr struct my_kelvin final : named_unit<"my_K", mag<10> * si::kelvin> { +constexpr struct my_kelvin final : named_unit<"my_K", mag<10> * si::kelvin> { } my_kelvin; static_assert(default_point_origin(si::kelvin) == si::absolute_zero); @@ -1516,7 +1516,7 @@ static_assert(ground_level - other_ground_level == -81 * m); static_assert(other_ground_level - tower_peak == 39 * m); static_assert(tower_peak - other_ground_level == -39 * m); -inline constexpr struct zero_m_per_s final : absolute_point_origin> { +constexpr struct zero_m_per_s final : absolute_point_origin> { } zero_m_per_s; // commutativity and associativity @@ -1604,7 +1604,7 @@ static_assert( is_of_type, int>>); -inline constexpr struct zero_Hz final : absolute_point_origin> { +constexpr struct zero_Hz final : absolute_point_origin> { } zero_Hz; static_assert(((zero_Hz + 10 / (2 * isq::period_duration[s])) + 5 * isq::frequency[Hz]).quantity_from(zero_Hz) == @@ -1688,7 +1688,7 @@ consteval bool invalid_subtraction(Ts... ts) return !requires { (... - ts); }; } -inline constexpr struct zero_Bq final : absolute_point_origin> { +constexpr struct zero_Bq final : absolute_point_origin> { } zero_Bq; static_assert(invalid_addition(zero_Bq + 5 * isq::activity[Bq], 5 * isq::frequency[Hz])); diff --git a/test/static/quantity_spec_test.cpp b/test/static/quantity_spec_test.cpp index ee4e86a8..8b5dc990 100644 --- a/test/static/quantity_spec_test.cpp +++ b/test/static/quantity_spec_test.cpp @@ -37,22 +37,22 @@ using dimensionless_ = struct dimensionless; using dim_one_ = struct dimension_one; // clang-format off -inline constexpr struct dim_length_ final : base_dimension<"L"> {} dim_length; -inline constexpr struct dim_mass_ final : base_dimension<"M"> {} dim_mass; -inline constexpr struct dim_time_ final : base_dimension<"T"> {} dim_time; +constexpr struct dim_length_ final : base_dimension<"L"> {} dim_length; +constexpr struct dim_mass_ final : base_dimension<"M"> {} dim_mass; +constexpr struct dim_time_ final : base_dimension<"T"> {} dim_time; // quantities specification QUANTITY_SPEC_(length, dim_length); QUANTITY_SPEC_(mass, dim_mass); QUANTITY_SPEC_(time, dim_time); -inline constexpr struct second_ final : named_unit<"s", kind_of