diff --git a/example/custom_systems.cpp b/example/custom_systems.cpp index f8dfd28f..8139420f 100644 --- a/example/custom_systems.cpp +++ b/example/custom_systems.cpp @@ -32,8 +32,8 @@ using namespace units; namespace fps { -struct foot : named_unit {}; -struct yard : named_scaled_unit {}; +struct foot : named_unit {}; +struct yard : named_scaled_unit {}; struct dim_length : base_dimension<"L", foot> {}; @@ -44,7 +44,7 @@ using length = quantity; namespace si { -struct metre : named_unit {}; +struct metre : named_unit {}; struct kilometre : prefixed_unit {}; struct dim_length : base_dimension<"L", metre> {}; @@ -54,8 +54,8 @@ using length = quantity; namespace fps { -struct foot : named_scaled_unit {}; -struct yard : named_scaled_unit {}; +struct foot : named_scaled_unit {}; +struct yard : named_scaled_unit {}; struct dim_length : base_dimension<"L", foot> {}; diff --git a/example/kalman_filter/kalman_filter-example_6.cpp b/example/kalman_filter/kalman_filter-example_6.cpp index fac8c34b..b77d3d62 100644 --- a/example/kalman_filter/kalman_filter-example_6.cpp +++ b/example/kalman_filter/kalman_filter-example_6.cpp @@ -32,7 +32,7 @@ // TODO Fix when Celsius is properly supported (#232) namespace units::isq::si { -struct degree_celsius : alias_unit {}; +struct degree_celsius : alias_unit {}; namespace thermodynamic_temperature_references { diff --git a/example/kalman_filter/kalman_filter-example_7.cpp b/example/kalman_filter/kalman_filter-example_7.cpp index 42ce7025..7387ab56 100644 --- a/example/kalman_filter/kalman_filter-example_7.cpp +++ b/example/kalman_filter/kalman_filter-example_7.cpp @@ -32,7 +32,7 @@ // TODO Fix when Celsius is properly supported (#232) namespace units::isq::si { -struct degree_celsius : alias_unit {}; +struct degree_celsius : alias_unit {}; namespace thermodynamic_temperature_references { diff --git a/example/kalman_filter/kalman_filter-example_8.cpp b/example/kalman_filter/kalman_filter-example_8.cpp index 3b81ae70..c2e0e1f6 100644 --- a/example/kalman_filter/kalman_filter-example_8.cpp +++ b/example/kalman_filter/kalman_filter-example_8.cpp @@ -32,7 +32,7 @@ // TODO Fix when Celsius is properly supported (#232) namespace units::isq::si { -struct degree_celsius : alias_unit {}; +struct degree_celsius : alias_unit {}; namespace thermodynamic_temperature_references { diff --git a/example/literals/custom_systems.cpp b/example/literals/custom_systems.cpp index f8fa8a3b..403475e1 100644 --- a/example/literals/custom_systems.cpp +++ b/example/literals/custom_systems.cpp @@ -32,8 +32,8 @@ using namespace units; namespace fps { -struct foot : named_unit {}; -struct yard : named_scaled_unit {}; +struct foot : named_unit {}; +struct yard : named_scaled_unit {}; struct dim_length : base_dimension<"L", foot> {}; @@ -44,7 +44,7 @@ using length = quantity; namespace si { -struct metre : named_unit {}; +struct metre : named_unit {}; struct kilometre : prefixed_unit {}; struct dim_length : base_dimension<"L", metre> {}; @@ -54,8 +54,8 @@ using length = quantity; namespace fps { -struct foot : named_scaled_unit {}; -struct yard : named_scaled_unit {}; +struct foot : named_scaled_unit {}; +struct yard : named_scaled_unit {}; struct dim_length : base_dimension<"L", foot> {}; diff --git a/src/core/include/units/bits/basic_concepts.h b/src/core/include/units/bits/basic_concepts.h index 617fec05..d3daf798 100644 --- a/src/core/include/units/bits/basic_concepts.h +++ b/src/core/include/units/bits/basic_concepts.h @@ -37,25 +37,14 @@ namespace units { -// PrefixFamily -struct prefix_family; - -/** - * @brief A concept matching a prefix family - * - * Satisfied by all types derived from `prefix_family` - */ -template -concept PrefixFamily = std::derived_from; - // Prefix namespace detail { -template +template struct prefix_base; -template -void to_prefix_base(const volatile prefix_base*); +template +void to_prefix_base(const volatile prefix_base*); } // namespace detail diff --git a/src/core/include/units/bits/unit_text.h b/src/core/include/units/bits/unit_text.h index 917c7f86..a8c323e4 100644 --- a/src/core/include/units/bits/unit_text.h +++ b/src/core/include/units/bits/unit_text.h @@ -57,28 +57,19 @@ constexpr auto ratio_text() } } -template +template constexpr auto prefix_or_ratio_text() { if constexpr (R.num == 1 && R.den == 1 && R.exp == 0) { // no ratio/prefix return basic_fixed_string(""); } else { - if constexpr (!is_same_v) { - // try to form a prefix - using prefix = downcast>; + // try to form a prefix + using prefix = downcast>; - if constexpr (!is_same_v>) { - // print as a prefixed unit - return prefix::symbol; - } else { - // print as a ratio of the coherent unit - constexpr auto txt = ratio_text(); - if constexpr (SymbolLen > 0 && txt.standard().size() > 0) - return txt + basic_fixed_string(" "); - else - return txt; - } + if constexpr (!is_same_v>) { + // print as a prefixed unit + return prefix::symbol; } else { // print as a ratio of the coherent unit constexpr auto txt = ratio_text(); @@ -151,15 +142,13 @@ constexpr auto unit_text() // use predefined coherent unit symbol constexpr auto symbol_text = coherent_unit::symbol; constexpr auto prefix_txt = - prefix_or_ratio_text(); + prefix_or_ratio_text(); return prefix_txt + symbol_text; } else { // use derived dimension ingredients to create a unit symbol constexpr auto symbol_text = derived_dimension_unit_text(); constexpr auto prefix_txt = - prefix_or_ratio_text(); + prefix_or_ratio_text(); return prefix_txt + symbol_text; } } diff --git a/src/core/include/units/generic/angle.h b/src/core/include/units/generic/angle.h index 9aefafbb..11017a68 100644 --- a/src/core/include/units/generic/angle.h +++ b/src/core/include/units/generic/angle.h @@ -32,7 +32,7 @@ namespace units { -struct radian : named_unit {}; +struct radian : named_unit {}; template struct dim_angle : base_dimension<"A", U> {}; diff --git a/src/core/include/units/generic/dimensionless.h b/src/core/include/units/generic/dimensionless.h index d1d34c2e..562977fc 100644 --- a/src/core/include/units/generic/dimensionless.h +++ b/src/core/include/units/generic/dimensionless.h @@ -30,8 +30,8 @@ namespace units { -struct one : named_unit {}; -struct percent : named_scaled_unit {}; +struct one : named_unit {}; +struct percent : named_scaled_unit {}; /** * @brief Dimension one diff --git a/src/core/include/units/prefix.h b/src/core/include/units/prefix.h index 0a9386d1..901a50bd 100644 --- a/src/core/include/units/prefix.h +++ b/src/core/include/units/prefix.h @@ -31,26 +31,10 @@ namespace units { -/** - * @brief The base for all prefix families - * - * Every prefix family should inherit from this type to satisfy PrefixFamily concept. - */ -struct prefix_family {}; - -/** - * @brief No prefix possible for the unit - * - * This is a special prefix type tag specifying that the unit can not be scaled with any kind - * of the prefix. - */ -struct no_prefix : prefix_family {}; - namespace detail { -template -struct prefix_base : downcast_base> { - using prefix_family = PF; +template +struct prefix_base : downcast_base> { static constexpr ::units::ratio ratio = R; }; @@ -63,17 +47,14 @@ struct prefix_base : downcast_base> { * - when defining a prefixed_unit its ratio is used to scale the reference unit and its * symbol is used to prepend to the symbol of referenced unit * - when printing the symbol of a scaled unit that was not predefined by the user but its - * factor matches ratio of a prefix from the specified prefix family, its symbol will be - * prepended to the symbol of the unit + * factor matches ratio of a prefix, its symbol will be prepended to the symbol of the unit * * @tparam Child inherited class type used by the downcasting facility (CRTP Idiom) - * @tparam PF a type of prefix family * @tparam Symbol a text representation of the prefix * @tparam R factor to be used to scale a unit */ -template - requires(!std::same_as) -struct prefix : downcast_dispatch, downcast_mode::on> { +template +struct prefix : downcast_dispatch, downcast_mode::on> { static constexpr auto symbol = Symbol; }; diff --git a/src/core/include/units/unit.h b/src/core/include/units/unit.h index 483826b4..386e360e 100644 --- a/src/core/include/units/unit.h +++ b/src/core/include/units/unit.h @@ -35,6 +35,13 @@ namespace units { +namespace detail { + +template +inline constexpr bool can_be_prefixed = false; + +} // namespace detail + /** * @brief A common point for a hierarchy of units * @@ -69,39 +76,31 @@ struct same_unit_reference : is_same +template struct named_unit : downcast_dispatch> { static constexpr auto symbol = Symbol; - using prefix_family = PF; }; /** - * @brief A scaled unit + * @brief A named scaled unit * - * Defines a new named unit that is a scaled version of another unit. Such unit can be used by - * other units defined with the prefix of the same type, unless no_prefix is provided for PF - * template parameter (in such a case it is impossible to define a prefix unit based on this - * one). + * Defines a new named unit that is a scaled version of another unit. + * A named unit may be composed with a prefix to create a prefixed_unit. * * @tparam Child inherited class type used by the downcasting facility (CRTP Idiom) * @tparam Symbol a short text representation of the unit - * @tparam PF no_prefix or a type of prefix family * @tparam R a scale to apply to U * @tparam U a reference unit to scale */ -template +template requires UnitRatio struct named_scaled_unit : downcast_dispatch> { static constexpr auto symbol = Symbol; - using prefix_family = PF; }; /** @@ -116,10 +115,9 @@ struct named_scaled_unit : downcast_dispatch - requires std::same_as + requires detail::can_be_prefixed struct prefixed_unit : downcast_dispatch> { static constexpr auto symbol = P::symbol + U::symbol; - using prefix_family = no_prefix; }; /** @@ -131,9 +129,7 @@ struct prefixed_unit : downcast_dispatch -struct derived_unit : downcast_dispatch> { - using prefix_family = no_prefix; -}; +struct derived_unit : downcast_dispatch> {}; /** * @brief A unit with a deduced ratio and symbol @@ -152,7 +148,6 @@ template requires detail::same_scaled_units struct derived_deduced_unit : downcast_dispatch> { static constexpr auto symbol = detail::derived_symbol_text(); - using prefix_family = no_prefix; }; /** @@ -160,18 +155,14 @@ struct derived_deduced_unit : downcast_dispatch +template struct alias_unit : U { static constexpr auto symbol = Symbol; - using prefix_family = PF; }; /** @@ -188,16 +179,15 @@ struct alias_unit : U { // TODO gcc bug: 95015 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95015 // template -// requires (!AliasUnit) && std::same_as +// requires (!AliasUnit) template - requires std::same_as + requires detail::can_be_prefixed struct prefixed_alias_unit : U { static constexpr auto symbol = P::symbol + AU::symbol; - using prefix_family = no_prefix; }; /** - * @brief Unknown unit + * @brief Unknown coherent unit * * Used as a coherent unit of an unknown dimension. */ @@ -205,17 +195,17 @@ struct unknown_coherent_unit : derived_unit {}; namespace detail { -template -void is_named_impl(const volatile named_unit*); +template +void is_named_impl(const volatile named_unit*); -template -void is_named_impl(const volatile named_scaled_unit*); +template +void is_named_impl(const volatile named_scaled_unit*); template void is_named_impl(const volatile prefixed_unit*); -template -void is_named_impl(const volatile alias_unit*); +template +void is_named_impl(const volatile alias_unit*); template void is_named_impl(const volatile prefixed_alias_unit*); @@ -223,6 +213,18 @@ void is_named_impl(const volatile prefixed_alias_unit*); template inline constexpr bool is_named = requires(U * u) { is_named_impl(u); }; +template +void can_be_prefixed_impl(const volatile named_unit*); + +template +void can_be_prefixed_impl(const volatile named_scaled_unit*); + +template +void can_be_prefixed_impl(const volatile alias_unit*); + +template +inline constexpr bool can_be_prefixed = requires(U * u) { can_be_prefixed_impl(u); }; + } // namespace detail } // namespace units diff --git a/src/systems/isq-iec80000/include/units/isq/iec80000/binary_prefixes.h b/src/systems/isq-iec80000/include/units/isq/iec80000/binary_prefixes.h index e842cf3e..1ff0679e 100644 --- a/src/systems/isq-iec80000/include/units/isq/iec80000/binary_prefixes.h +++ b/src/systems/isq-iec80000/include/units/isq/iec80000/binary_prefixes.h @@ -26,13 +26,11 @@ namespace units::isq::iec80000 { -struct binary_prefix : prefix_family {}; - -struct kibi : units::prefix {}; -struct mebi : units::prefix {}; -struct gibi : units::prefix {}; -struct tebi : units::prefix {}; -struct pebi : units::prefix {}; -struct exbi : units::prefix {}; +struct kibi : units::prefix {}; +struct mebi : units::prefix {}; +struct gibi : units::prefix {}; +struct tebi : units::prefix {}; +struct pebi : units::prefix {}; +struct exbi : units::prefix {}; } // namespace units::isq::iec80000 diff --git a/src/systems/isq-iec80000/include/units/isq/iec80000/modulation_rate.h b/src/systems/isq-iec80000/include/units/isq/iec80000/modulation_rate.h index dcb3d805..40bf6d24 100644 --- a/src/systems/isq-iec80000/include/units/isq/iec80000/modulation_rate.h +++ b/src/systems/isq-iec80000/include/units/isq/iec80000/modulation_rate.h @@ -34,7 +34,7 @@ namespace units::isq::iec80000 { -struct baud : alias_unit {}; +struct baud : alias_unit {}; struct kilobaud : prefixed_alias_unit {}; struct megabaud : prefixed_alias_unit {}; struct gigabaud : prefixed_alias_unit {}; diff --git a/src/systems/isq-iec80000/include/units/isq/iec80000/storage_capacity.h b/src/systems/isq-iec80000/include/units/isq/iec80000/storage_capacity.h index c8ea04f7..f88b5710 100644 --- a/src/systems/isq-iec80000/include/units/isq/iec80000/storage_capacity.h +++ b/src/systems/isq-iec80000/include/units/isq/iec80000/storage_capacity.h @@ -35,7 +35,8 @@ namespace units::isq::iec80000 { -struct bit : named_unit {}; +struct bit : named_unit {}; + struct kilobit : prefixed_unit {}; struct megabit : prefixed_unit {}; struct gigabit : prefixed_unit {}; @@ -45,15 +46,15 @@ struct exabit : prefixed_unit {}; struct zettabit : prefixed_unit {}; struct yottabit : prefixed_unit {}; -struct binary_prefix_bit : alias_unit {}; -struct kibibit : prefixed_unit {}; -struct mebibit : prefixed_unit {}; -struct gibibit : prefixed_unit {}; -struct tebibit : prefixed_unit {}; -struct pebibit : prefixed_unit {}; -struct exbibit : prefixed_unit {}; +struct kibibit : prefixed_unit {}; +struct mebibit : prefixed_unit {}; +struct gibibit : prefixed_unit {}; +struct tebibit : prefixed_unit {}; +struct pebibit : prefixed_unit {}; +struct exbibit : prefixed_unit {}; + +struct byte : named_scaled_unit {}; -struct byte : named_scaled_unit {}; struct kilobyte : prefixed_unit {}; struct megabyte : prefixed_unit {}; struct gigabyte : prefixed_unit {}; @@ -63,13 +64,12 @@ struct exabyte : prefixed_unit {}; struct zettabyte : prefixed_unit {}; struct yottabyte : prefixed_unit {}; -struct binary_prefix_byte : alias_unit {}; -struct kibibyte : prefixed_unit {}; -struct mebibyte : prefixed_unit {}; -struct gibibyte : prefixed_unit {}; -struct tebibyte : prefixed_unit {}; -struct pebibyte : prefixed_unit {}; -// struct exbibyte : prefixed_unit {}; +struct kibibyte : prefixed_unit {}; +struct mebibyte : prefixed_unit {}; +struct gibibyte : prefixed_unit {}; +struct tebibyte : prefixed_unit {}; +struct pebibyte : prefixed_unit {}; +// struct exbibyte : prefixed_unit {}; struct dim_storage_capacity : base_dimension<"M", byte> {}; diff --git a/src/systems/isq-iec80000/include/units/isq/iec80000/traffic_intensity.h b/src/systems/isq-iec80000/include/units/isq/iec80000/traffic_intensity.h index 3c17f62d..03a31646 100644 --- a/src/systems/isq-iec80000/include/units/isq/iec80000/traffic_intensity.h +++ b/src/systems/isq-iec80000/include/units/isq/iec80000/traffic_intensity.h @@ -33,7 +33,7 @@ namespace units::isq::iec80000 { -struct erlang : named_unit {}; +struct erlang : named_unit {}; struct dim_traffic_intensity : base_dimension<"A", erlang> {}; diff --git a/src/systems/isq-natural/include/units/isq/natural/units.h b/src/systems/isq-natural/include/units/isq/natural/units.h index 1d64e28b..82712296 100644 --- a/src/systems/isq-natural/include/units/isq/natural/units.h +++ b/src/systems/isq-natural/include/units/isq/natural/units.h @@ -31,11 +31,10 @@ namespace units::isq::natural { -struct electronvolt : named_unit {}; +struct electronvolt : named_unit {}; struct gigaelectronvolt : prefixed_unit {}; -struct inverted_gigaelectronvolt : - named_unit {}; -struct square_gigaelectronvolt : named_unit {}; +struct inverted_gigaelectronvolt : named_unit {}; +struct square_gigaelectronvolt : named_unit {}; // NOTE: eV as a base unit with no relation to joule prevents us from going back // from natural units to SI. Do we need such a support or should we treat diff --git a/src/systems/si-cgs/include/units/isq/si/cgs/acceleration.h b/src/systems/si-cgs/include/units/isq/si/cgs/acceleration.h index 53d56784..fc983980 100644 --- a/src/systems/si-cgs/include/units/isq/si/cgs/acceleration.h +++ b/src/systems/si-cgs/include/units/isq/si/cgs/acceleration.h @@ -34,7 +34,7 @@ namespace units::isq::si::cgs { -struct gal : named_unit {}; +struct gal : named_unit {}; struct dim_acceleration : isq::dim_acceleration {}; template U, Representation Rep = double> diff --git a/src/systems/si-cgs/include/units/isq/si/cgs/energy.h b/src/systems/si-cgs/include/units/isq/si/cgs/energy.h index d6e0c16b..7ca8af7f 100644 --- a/src/systems/si-cgs/include/units/isq/si/cgs/energy.h +++ b/src/systems/si-cgs/include/units/isq/si/cgs/energy.h @@ -35,7 +35,7 @@ namespace units::isq::si::cgs { -struct erg : named_unit {}; +struct erg : named_unit {}; struct dim_energy : isq::dim_energy {}; diff --git a/src/systems/si-cgs/include/units/isq/si/cgs/force.h b/src/systems/si-cgs/include/units/isq/si/cgs/force.h index e00f5a0d..f6f7bca3 100644 --- a/src/systems/si-cgs/include/units/isq/si/cgs/force.h +++ b/src/systems/si-cgs/include/units/isq/si/cgs/force.h @@ -36,7 +36,7 @@ namespace units::isq::si::cgs { -struct dyne : named_unit {}; +struct dyne : named_unit {}; struct dim_force : isq::dim_force {}; diff --git a/src/systems/si-cgs/include/units/isq/si/cgs/pressure.h b/src/systems/si-cgs/include/units/isq/si/cgs/pressure.h index 5d4f89ea..e3b1a36a 100644 --- a/src/systems/si-cgs/include/units/isq/si/cgs/pressure.h +++ b/src/systems/si-cgs/include/units/isq/si/cgs/pressure.h @@ -36,7 +36,7 @@ namespace units::isq::si::cgs { -struct barye : named_unit {}; +struct barye : named_unit {}; struct dim_pressure : isq::dim_pressure {}; diff --git a/src/systems/si-fps/include/units/isq/si/fps/force.h b/src/systems/si-fps/include/units/isq/si/fps/force.h index 8958ca44..19f52527 100644 --- a/src/systems/si-fps/include/units/isq/si/fps/force.h +++ b/src/systems/si-fps/include/units/isq/si/fps/force.h @@ -37,15 +37,15 @@ namespace units::isq::si::fps { // https://en.wikipedia.org/wiki/Poundal -struct poundal : named_unit {}; +struct poundal : named_unit {}; // https://en.wikipedia.org/wiki/Pound_(force) -struct pound_force : named_scaled_unit {}; +struct pound_force : named_scaled_unit {}; struct kilopound_force : prefixed_unit {}; // https://en.wikipedia.org/wiki/Kip_(unit), -struct kip : alias_unit {}; +struct kip : alias_unit {}; struct dim_force : isq::dim_force {}; diff --git a/src/systems/si-fps/include/units/isq/si/fps/length.h b/src/systems/si-fps/include/units/isq/si/fps/length.h index c33819cd..8f307136 100644 --- a/src/systems/si-fps/include/units/isq/si/fps/length.h +++ b/src/systems/si-fps/include/units/isq/si/fps/length.h @@ -43,13 +43,13 @@ using si::international::thou; using si::international::yard; // thousandth of an inch -struct thousandth : alias_unit {}; +struct thousandth : alias_unit {}; struct kiloyard : prefixed_unit {}; -struct mile : named_scaled_unit {}; +struct mile : named_scaled_unit {}; -struct nautical_mile : named_scaled_unit {}; +struct nautical_mile : named_scaled_unit {}; struct dim_length : isq::dim_length {}; diff --git a/src/systems/si-fps/include/units/isq/si/fps/mass.h b/src/systems/si-fps/include/units/isq/si/fps/mass.h index 559593d0..2891c8bc 100644 --- a/src/systems/si-fps/include/units/isq/si/fps/mass.h +++ b/src/systems/si-fps/include/units/isq/si/fps/mass.h @@ -35,28 +35,28 @@ namespace units::isq::si::fps { // https://en.wikipedia.org/wiki/Pound_(mass) -struct pound : named_scaled_unit {}; +struct pound : named_scaled_unit {}; struct dim_mass : isq::dim_mass {}; template U, Representation Rep = double> using mass = quantity; -struct grain : named_scaled_unit {}; +struct grain : named_scaled_unit {}; -struct dram : named_scaled_unit {}; +struct dram : named_scaled_unit {}; -struct ounce : named_scaled_unit {}; +struct ounce : named_scaled_unit {}; -struct stone : named_scaled_unit {}; +struct stone : named_scaled_unit {}; -struct quarter : named_scaled_unit {}; +struct quarter : named_scaled_unit {}; -struct hundredweight : named_scaled_unit {}; +struct hundredweight : named_scaled_unit {}; -struct short_ton : named_scaled_unit {}; +struct short_ton : named_scaled_unit {}; -struct long_ton : named_scaled_unit {}; +struct long_ton : named_scaled_unit {}; #ifndef UNITS_NO_LITERALS diff --git a/src/systems/si-fps/include/units/isq/si/fps/power.h b/src/systems/si-fps/include/units/isq/si/fps/power.h index d168ac6d..89b9243f 100644 --- a/src/systems/si-fps/include/units/isq/si/fps/power.h +++ b/src/systems/si-fps/include/units/isq/si/fps/power.h @@ -42,7 +42,7 @@ struct dim_power : isq::dim_power {}; -struct horse_power : named_scaled_unit {}; +struct horse_power : named_scaled_unit {}; template U, Representation Rep = double> using power = quantity; diff --git a/src/systems/si-fps/include/units/isq/si/fps/pressure.h b/src/systems/si-fps/include/units/isq/si/fps/pressure.h index 84658252..31128c33 100644 --- a/src/systems/si-fps/include/units/isq/si/fps/pressure.h +++ b/src/systems/si-fps/include/units/isq/si/fps/pressure.h @@ -44,11 +44,10 @@ template U, Representation Rep = double> using pressure = quantity; struct pound_force_per_foot_sq : - named_scaled_unit {}; + named_scaled_unit {}; struct pound_force_per_inch_sq : - named_scaled_unit {}; + named_scaled_unit {}; struct kilopound_force_per_inch_sq : prefixed_unit {}; diff --git a/src/systems/si-fps/include/units/isq/si/fps/speed.h b/src/systems/si-fps/include/units/isq/si/fps/speed.h index 0fb4fbb4..1f4916fd 100644 --- a/src/systems/si-fps/include/units/isq/si/fps/speed.h +++ b/src/systems/si-fps/include/units/isq/si/fps/speed.h @@ -43,7 +43,7 @@ using speed = quantity; struct mile_per_hour : derived_deduced_unit {}; struct nautical_mile_per_hour : derived_deduced_unit {}; -struct knot : alias_unit {}; +struct knot : alias_unit {}; #ifndef UNITS_NO_LITERALS diff --git a/src/systems/si-hep/include/units/isq/si/hep/area.h b/src/systems/si-hep/include/units/isq/si/hep/area.h index da988438..dc8e5895 100644 --- a/src/systems/si-hep/include/units/isq/si/hep/area.h +++ b/src/systems/si-hep/include/units/isq/si/hep/area.h @@ -37,7 +37,7 @@ namespace units::isq::si::hep { // 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 -struct barn : named_scaled_unit {}; +struct barn : named_scaled_unit {}; struct yocto_barn : prefixed_unit {}; struct zepto_barn : prefixed_unit {}; struct atto_barn : prefixed_unit {}; diff --git a/src/systems/si-hep/include/units/isq/si/hep/mass.h b/src/systems/si-hep/include/units/isq/si/hep/mass.h index 2f617544..10de3a3f 100644 --- a/src/systems/si-hep/include/units/isq/si/hep/mass.h +++ b/src/systems/si-hep/include/units/isq/si/hep/mass.h @@ -35,7 +35,7 @@ namespace units::isq::si::hep { struct eV_per_c2 : - named_scaled_unit {}; struct feV_per_c2 : prefixed_unit {}; struct peV_per_c2 : prefixed_unit {}; @@ -52,11 +52,10 @@ struct PeV_per_c2 : prefixed_unit {}; struct EeV_per_c2 : prefixed_unit {}; struct YeV_per_c2 : prefixed_unit {}; struct electron_mass : - named_scaled_unit {}; -struct proton_mass : - named_scaled_unit {}; + named_scaled_unit {}; +struct proton_mass : named_scaled_unit {}; struct neutron_mass : - named_scaled_unit {}; + named_scaled_unit {}; struct dim_mass : isq::dim_mass {}; diff --git a/src/systems/si-hep/include/units/isq/si/hep/momentum.h b/src/systems/si-hep/include/units/isq/si/hep/momentum.h index 26417868..83557347 100644 --- a/src/systems/si-hep/include/units/isq/si/hep/momentum.h +++ b/src/systems/si-hep/include/units/isq/si/hep/momentum.h @@ -37,8 +37,7 @@ namespace units::isq::si::hep { struct kilogram_metre_per_second : derived_unit {}; struct eV_per_c : - named_scaled_unit {}; + named_scaled_unit {}; struct feV_per_c : prefixed_unit {}; struct peV_per_c : prefixed_unit {}; struct neV_per_c : prefixed_unit {}; diff --git a/src/systems/si-iau/include/units/isq/si/iau/length.h b/src/systems/si-iau/include/units/isq/si/iau/length.h index ce0d1059..1c50ccc1 100644 --- a/src/systems/si-iau/include/units/isq/si/iau/length.h +++ b/src/systems/si-iau/include/units/isq/si/iau/length.h @@ -36,13 +36,13 @@ namespace units::isq::si::iau { // https://en.wikipedia.org/wiki/Light-year -struct light_year : named_scaled_unit {}; +struct light_year : named_scaled_unit {}; // https://en.wikipedia.org/wiki/Parsec -struct parsec : named_scaled_unit {}; +struct parsec : named_scaled_unit {}; // https://en.wikipedia.org/wiki/Angstrom -struct angstrom : named_scaled_unit {}; +struct angstrom : named_scaled_unit {}; #ifndef UNITS_NO_LITERALS diff --git a/src/systems/si-imperial/include/units/isq/si/imperial/length.h b/src/systems/si-imperial/include/units/isq/si/imperial/length.h index eb5978c3..8721ae4d 100644 --- a/src/systems/si-imperial/include/units/isq/si/imperial/length.h +++ b/src/systems/si-imperial/include/units/isq/si/imperial/length.h @@ -35,10 +35,10 @@ namespace units::isq::si::imperial { // https://en.wikipedia.org/wiki/Chain_(unit) -struct chain : named_scaled_unit {}; +struct chain : named_scaled_unit {}; // https://en.wikipedia.org/wiki/Rod_(unit) -struct rod : named_scaled_unit {}; +struct rod : named_scaled_unit {}; #ifndef UNITS_NO_LITERALS diff --git a/src/systems/si-international/include/units/isq/si/international/length.h b/src/systems/si-international/include/units/isq/si/international/length.h index ead14a46..4f93feae 100644 --- a/src/systems/si-international/include/units/isq/si/international/length.h +++ b/src/systems/si-international/include/units/isq/si/international/length.h @@ -37,30 +37,30 @@ namespace units::isq::si::international { // si::international yard // https://en.wikipedia.org/wiki/International_yard_and_pound -struct yard : named_scaled_unit {}; +struct yard : named_scaled_unit {}; // si::international foot // https://en.wikipedia.org/wiki/Foot_(unit)#International_foot -struct foot : named_scaled_unit {}; +struct foot : named_scaled_unit {}; // https://en.wikipedia.org/wiki/Fathom#International_fathom -struct fathom : named_scaled_unit {}; +struct fathom : named_scaled_unit {}; // si::international inch // https://en.wikipedia.org/wiki/Inch#Equivalences -struct inch : named_scaled_unit {}; +struct inch : named_scaled_unit {}; // intrnational mile // https://en.wikipedia.org/wiki/Mile#International_mile -struct mile : named_scaled_unit {}; +struct mile : named_scaled_unit {}; // si::international nautical mile // https://en.wikipedia.org/wiki/Nautical_mile -struct nautical_mile : named_scaled_unit {}; +struct nautical_mile : named_scaled_unit {}; // thou // https://en.wikipedia.org/wiki/Thousandth_of_an_inch -struct thou : named_scaled_unit {}; +struct thou : named_scaled_unit {}; // mil - different name for thou // https://en.wikipedia.org/wiki/Thousandth_of_an_inch diff --git a/src/systems/si-international/include/units/isq/si/international/speed.h b/src/systems/si-international/include/units/isq/si/international/speed.h index 16ef5a66..3081dd91 100644 --- a/src/systems/si-international/include/units/isq/si/international/speed.h +++ b/src/systems/si-international/include/units/isq/si/international/speed.h @@ -37,7 +37,7 @@ namespace units::isq::si::international { struct mile_per_hour : derived_deduced_unit {}; struct nautical_mile_per_hour : derived_deduced_unit {}; -struct knot : alias_unit {}; +struct knot : alias_unit {}; #ifndef UNITS_NO_LITERALS diff --git a/src/systems/si-typographic/include/units/isq/si/typographic/length.h b/src/systems/si-typographic/include/units/isq/si/typographic/length.h index cb3c691e..5e88390d 100644 --- a/src/systems/si-typographic/include/units/isq/si/typographic/length.h +++ b/src/systems/si-typographic/include/units/isq/si/typographic/length.h @@ -37,10 +37,10 @@ namespace units::isq::si::typographic { // TODO Conflicts with (https://en.wikipedia.org/wiki/Pica_(typography)), verify correctness of below conversion factors // and provide hyperlinks to definitions -struct pica_comp : named_scaled_unit {}; -struct pica_prn : named_scaled_unit {}; -struct point_comp : named_scaled_unit {}; -struct point_prn : named_scaled_unit {}; +struct pica_comp : named_scaled_unit {}; +struct pica_prn : named_scaled_unit {}; +struct point_comp : named_scaled_unit {}; +struct point_prn : named_scaled_unit {}; #ifndef UNITS_NO_LITERALS diff --git a/src/systems/si-uscs/include/units/isq/si/uscs/length.h b/src/systems/si-uscs/include/units/isq/si/uscs/length.h index b1c06b5f..8c09a57d 100644 --- a/src/systems/si-uscs/include/units/isq/si/uscs/length.h +++ b/src/systems/si-uscs/include/units/isq/si/uscs/length.h @@ -36,14 +36,14 @@ namespace units::isq::si::uscs { // https://en.wikipedia.org/wiki/Foot_(unit)#US_survey_foot // https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors#B6 -struct foot : named_scaled_unit {}; +struct foot : named_scaled_unit {}; // https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors#B6 -struct fathom : named_scaled_unit {}; +struct fathom : named_scaled_unit {}; // https://en.wikipedia.org/wiki/Mile#U.S._survey_mile // https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors#B6 -struct mile : named_scaled_unit {}; +struct mile : named_scaled_unit {}; #ifndef UNITS_NO_LITERALS diff --git a/src/systems/si/include/units/isq/si/absorbed_dose.h b/src/systems/si/include/units/isq/si/absorbed_dose.h index 965665e8..40159573 100644 --- a/src/systems/si/include/units/isq/si/absorbed_dose.h +++ b/src/systems/si/include/units/isq/si/absorbed_dose.h @@ -35,7 +35,7 @@ namespace units::isq::si { -struct gray : named_unit {}; +struct gray : named_unit {}; struct yoctogray : prefixed_unit {}; struct zeptogray : prefixed_unit {}; struct attogray : prefixed_unit {}; diff --git a/src/systems/si/include/units/isq/si/amount_of_substance.h b/src/systems/si/include/units/isq/si/amount_of_substance.h index e5d40c80..ba7578d8 100644 --- a/src/systems/si/include/units/isq/si/amount_of_substance.h +++ b/src/systems/si/include/units/isq/si/amount_of_substance.h @@ -34,7 +34,7 @@ namespace units::isq::si { -struct mole : named_unit {}; +struct mole : named_unit {}; struct dim_amount_of_substance : isq::dim_amount_of_substance {}; diff --git a/src/systems/si/include/units/isq/si/angular_velocity.h b/src/systems/si/include/units/isq/si/angular_velocity.h index 0cbcf686..4c606798 100644 --- a/src/systems/si/include/units/isq/si/angular_velocity.h +++ b/src/systems/si/include/units/isq/si/angular_velocity.h @@ -35,7 +35,7 @@ namespace units::isq::si { -struct radian_per_second : named_unit {}; +struct radian_per_second : named_unit {}; struct dim_angular_velocity : isq::dim_angular_velocity, dim_time> {}; diff --git a/src/systems/si/include/units/isq/si/area.h b/src/systems/si/include/units/isq/si/area.h index a3818096..f95dfc08 100644 --- a/src/systems/si/include/units/isq/si/area.h +++ b/src/systems/si/include/units/isq/si/area.h @@ -58,7 +58,7 @@ struct square_exametre : derived_deduced_unit {}; struct square_yottametre : derived_deduced_unit {}; -struct are : alias_unit {}; +struct are : alias_unit {}; struct centiare : prefixed_alias_unit {}; struct deciare : prefixed_unit {}; struct decare : prefixed_unit {}; diff --git a/src/systems/si/include/units/isq/si/capacitance.h b/src/systems/si/include/units/isq/si/capacitance.h index ddea6793..31a477f9 100644 --- a/src/systems/si/include/units/isq/si/capacitance.h +++ b/src/systems/si/include/units/isq/si/capacitance.h @@ -36,7 +36,7 @@ namespace units::isq::si { -struct farad : named_unit {}; +struct farad : named_unit {}; struct yoctofarad : prefixed_unit {}; struct zeptofarad : prefixed_unit {}; struct attofarad : prefixed_unit {}; diff --git a/src/systems/si/include/units/isq/si/catalytic_activity.h b/src/systems/si/include/units/isq/si/catalytic_activity.h index 9c348d88..d52e81ac 100644 --- a/src/systems/si/include/units/isq/si/catalytic_activity.h +++ b/src/systems/si/include/units/isq/si/catalytic_activity.h @@ -36,7 +36,7 @@ namespace units::isq::si { -struct katal : named_unit {}; +struct katal : named_unit {}; struct yoctokatal : prefixed_unit {}; struct zeptokatal : prefixed_unit {}; struct attokatal : prefixed_unit {}; @@ -58,7 +58,7 @@ struct exakatal : prefixed_unit {}; struct zettakatal : prefixed_unit {}; struct yottakatal : prefixed_unit {}; -struct enzyme_unit : named_scaled_unit {}; +struct enzyme_unit : named_scaled_unit {}; struct dim_catalytic_activity : isq::dim_catalytic_activity {}; diff --git a/src/systems/si/include/units/isq/si/conductance.h b/src/systems/si/include/units/isq/si/conductance.h index 36b8cc13..5442201f 100644 --- a/src/systems/si/include/units/isq/si/conductance.h +++ b/src/systems/si/include/units/isq/si/conductance.h @@ -35,7 +35,7 @@ namespace units::isq::si { -struct siemens : named_unit {}; +struct siemens : named_unit {}; struct yoctosiemens : prefixed_unit {}; struct zeptosiemens : prefixed_unit {}; struct attosiemens : prefixed_unit {}; diff --git a/src/systems/si/include/units/isq/si/electric_charge.h b/src/systems/si/include/units/isq/si/electric_charge.h index cb79b848..ca431827 100644 --- a/src/systems/si/include/units/isq/si/electric_charge.h +++ b/src/systems/si/include/units/isq/si/electric_charge.h @@ -35,7 +35,7 @@ namespace units::isq::si { -struct coulomb : named_unit {}; +struct coulomb : named_unit {}; struct dim_electric_charge : isq::dim_electric_charge {}; diff --git a/src/systems/si/include/units/isq/si/electric_current.h b/src/systems/si/include/units/isq/si/electric_current.h index 23c12021..740eb113 100644 --- a/src/systems/si/include/units/isq/si/electric_current.h +++ b/src/systems/si/include/units/isq/si/electric_current.h @@ -34,7 +34,7 @@ namespace units::isq::si { -struct ampere : named_unit {}; +struct ampere : named_unit {}; struct yoctoampere : prefixed_unit {}; struct zeptoampere : prefixed_unit {}; struct attoampere : prefixed_unit {}; diff --git a/src/systems/si/include/units/isq/si/energy.h b/src/systems/si/include/units/isq/si/energy.h index 2ca2fc9b..cb841b4b 100644 --- a/src/systems/si/include/units/isq/si/energy.h +++ b/src/systems/si/include/units/isq/si/energy.h @@ -35,7 +35,7 @@ namespace units::isq::si { -struct joule : named_unit {}; +struct joule : named_unit {}; struct yoctojoule : prefixed_unit {}; struct zeptojoule : prefixed_unit {}; struct attojoule : prefixed_unit {}; @@ -55,7 +55,7 @@ struct yottajoule : prefixed_unit {}; // N.B. electron charge (and eV) is an exact constant: // https://www.bipm.org/documents/20126/41483022/SI-Brochure-9.pdf#page=147 -struct electronvolt : named_scaled_unit {}; +struct electronvolt : named_scaled_unit {}; struct gigaelectronvolt : prefixed_unit {}; struct dim_energy : isq::dim_energy {}; diff --git a/src/systems/si/include/units/isq/si/force.h b/src/systems/si/include/units/isq/si/force.h index c0977aaf..fa2c1880 100644 --- a/src/systems/si/include/units/isq/si/force.h +++ b/src/systems/si/include/units/isq/si/force.h @@ -36,7 +36,7 @@ namespace units::isq::si { -struct newton : named_unit {}; +struct newton : named_unit {}; struct yoctonewton : prefixed_unit {}; struct zeptonewton : prefixed_unit {}; struct attonewton : prefixed_unit {}; diff --git a/src/systems/si/include/units/isq/si/frequency.h b/src/systems/si/include/units/isq/si/frequency.h index 0a9bd90a..39fa13ee 100644 --- a/src/systems/si/include/units/isq/si/frequency.h +++ b/src/systems/si/include/units/isq/si/frequency.h @@ -34,7 +34,7 @@ namespace units::isq::si { -struct hertz : named_unit {}; +struct hertz : named_unit {}; struct yoctohertz : prefixed_unit {}; struct zeptohertz : prefixed_unit {}; struct attohertz : prefixed_unit {}; diff --git a/src/systems/si/include/units/isq/si/inductance.h b/src/systems/si/include/units/isq/si/inductance.h index e3eb6ee7..c6a14a98 100644 --- a/src/systems/si/include/units/isq/si/inductance.h +++ b/src/systems/si/include/units/isq/si/inductance.h @@ -35,7 +35,7 @@ namespace units::isq::si { -struct henry : named_unit {}; +struct henry : named_unit {}; struct yoctohenry : prefixed_unit {}; struct zeptohenry : prefixed_unit {}; diff --git a/src/systems/si/include/units/isq/si/length.h b/src/systems/si/include/units/isq/si/length.h index 36022dbd..0e7f28fd 100644 --- a/src/systems/si/include/units/isq/si/length.h +++ b/src/systems/si/include/units/isq/si/length.h @@ -34,7 +34,7 @@ namespace units::isq::si { -struct metre : named_unit {}; +struct metre : named_unit {}; struct yoctometre : prefixed_unit {}; struct zeptometre : prefixed_unit {}; struct attometre : prefixed_unit {}; @@ -56,7 +56,7 @@ struct exametre : prefixed_unit {}; struct zettametre : prefixed_unit {}; struct yottametre : prefixed_unit {}; -struct astronomical_unit : named_scaled_unit {}; +struct astronomical_unit : named_scaled_unit {}; struct dim_length : isq::dim_length {}; diff --git a/src/systems/si/include/units/isq/si/luminous_intensity.h b/src/systems/si/include/units/isq/si/luminous_intensity.h index e4eff3c5..38e658f0 100644 --- a/src/systems/si/include/units/isq/si/luminous_intensity.h +++ b/src/systems/si/include/units/isq/si/luminous_intensity.h @@ -34,7 +34,7 @@ namespace units::isq::si { -struct candela : named_unit {}; +struct candela : named_unit {}; struct yoctocandela : prefixed_unit {}; struct zeptocandela : prefixed_unit {}; struct attocandela : prefixed_unit {}; diff --git a/src/systems/si/include/units/isq/si/magnetic_flux.h b/src/systems/si/include/units/isq/si/magnetic_flux.h index 57c1317d..77b1410c 100644 --- a/src/systems/si/include/units/isq/si/magnetic_flux.h +++ b/src/systems/si/include/units/isq/si/magnetic_flux.h @@ -35,7 +35,7 @@ namespace units::isq::si { -struct weber : named_unit {}; +struct weber : named_unit {}; struct yoctoweber : prefixed_unit {}; struct zeptoweber : prefixed_unit {}; diff --git a/src/systems/si/include/units/isq/si/magnetic_induction.h b/src/systems/si/include/units/isq/si/magnetic_induction.h index 353a3af0..a1a7f507 100644 --- a/src/systems/si/include/units/isq/si/magnetic_induction.h +++ b/src/systems/si/include/units/isq/si/magnetic_induction.h @@ -37,7 +37,7 @@ namespace units::isq::si { -struct tesla : named_unit {}; +struct tesla : named_unit {}; struct yoctotesla : prefixed_unit {}; struct zeptotesla : prefixed_unit {}; @@ -56,7 +56,7 @@ struct exatesla : prefixed_unit {}; struct zettatesla : prefixed_unit {}; struct yottatesla : prefixed_unit {}; -struct gauss : named_scaled_unit {}; +struct gauss : named_scaled_unit {}; struct dim_magnetic_induction : isq::dim_magnetic_induction {}; diff --git a/src/systems/si/include/units/isq/si/mass.h b/src/systems/si/include/units/isq/si/mass.h index 89776694..dd877f26 100644 --- a/src/systems/si/include/units/isq/si/mass.h +++ b/src/systems/si/include/units/isq/si/mass.h @@ -34,7 +34,7 @@ namespace units::isq::si { -struct gram : named_unit {}; +struct gram : named_unit {}; struct yoctogram : prefixed_unit {}; struct zeptogram : prefixed_unit {}; struct attogram : prefixed_unit {}; @@ -56,7 +56,7 @@ struct exagram : prefixed_unit {}; struct zettagram : prefixed_unit {}; struct yottagram : prefixed_unit {}; -struct tonne : alias_unit {}; +struct tonne : alias_unit {}; struct yoctotonne : prefixed_alias_unit {}; struct zeptotonne : prefixed_alias_unit {}; struct attotonne : prefixed_alias_unit {}; @@ -78,8 +78,7 @@ struct exatonne : prefixed_alias_unit {}; struct zettatonne : prefixed_unit {}; struct yottatonne : prefixed_unit {}; -struct dalton : - named_scaled_unit {}; +struct dalton : named_scaled_unit {}; struct dim_mass : isq::dim_mass {}; diff --git a/src/systems/si/include/units/isq/si/power.h b/src/systems/si/include/units/isq/si/power.h index 360e92e9..d95d5c30 100644 --- a/src/systems/si/include/units/isq/si/power.h +++ b/src/systems/si/include/units/isq/si/power.h @@ -35,7 +35,7 @@ namespace units::isq::si { -struct watt : named_unit {}; +struct watt : named_unit {}; struct yoctowatt : prefixed_unit {}; struct zeptowatt : prefixed_unit {}; struct attowatt : prefixed_unit {}; diff --git a/src/systems/si/include/units/isq/si/prefixes.h b/src/systems/si/include/units/isq/si/prefixes.h index a6e9cd08..0efabcf3 100644 --- a/src/systems/si/include/units/isq/si/prefixes.h +++ b/src/systems/si/include/units/isq/si/prefixes.h @@ -26,29 +26,27 @@ namespace units::isq::si { -struct prefix : prefix_family {}; - // clang-format off -struct yocto : units::prefix {}; -struct zepto : units::prefix {}; -struct atto : units::prefix {}; -struct femto : units::prefix {}; -struct pico : units::prefix {}; -struct nano : units::prefix {}; -struct micro : units::prefix {}; -struct milli : units::prefix {}; -struct centi : units::prefix {}; -struct deci : units::prefix {}; -struct deca : units::prefix {}; -struct hecto : units::prefix {}; -struct kilo : units::prefix {}; -struct mega : units::prefix {}; -struct giga : units::prefix {}; -struct tera : units::prefix {}; -struct peta : units::prefix {}; -struct exa : units::prefix {}; -struct zetta : units::prefix {}; -struct yotta : units::prefix {}; +struct yocto : units::prefix {}; +struct zepto : units::prefix {}; +struct atto : units::prefix {}; +struct femto : units::prefix {}; +struct pico : units::prefix {}; +struct nano : units::prefix {}; +struct micro : units::prefix {}; +struct milli : units::prefix {}; +struct centi : units::prefix {}; +struct deci : units::prefix {}; +struct deca : units::prefix {}; +struct hecto : units::prefix {}; +struct kilo : units::prefix {}; +struct mega : units::prefix {}; +struct giga : units::prefix {}; +struct tera : units::prefix {}; +struct peta : units::prefix {}; +struct exa : units::prefix {}; +struct zetta : units::prefix {}; +struct yotta : units::prefix {}; // clang-format on } // namespace units::isq::si diff --git a/src/systems/si/include/units/isq/si/pressure.h b/src/systems/si/include/units/isq/si/pressure.h index b3c94279..86bed5d2 100644 --- a/src/systems/si/include/units/isq/si/pressure.h +++ b/src/systems/si/include/units/isq/si/pressure.h @@ -36,7 +36,7 @@ namespace units::isq::si { -struct pascal : named_unit {}; +struct pascal : named_unit {}; struct yoctopascal : prefixed_unit {}; struct zeptopascal : prefixed_unit {}; struct attopascal : prefixed_unit {}; diff --git a/src/systems/si/include/units/isq/si/radioactivity.h b/src/systems/si/include/units/isq/si/radioactivity.h index 7db478d1..d46c81e4 100644 --- a/src/systems/si/include/units/isq/si/radioactivity.h +++ b/src/systems/si/include/units/isq/si/radioactivity.h @@ -34,7 +34,7 @@ namespace units::isq::si { -struct becquerel : named_unit {}; +struct becquerel : named_unit {}; struct yoctobecquerel : prefixed_unit {}; struct zeptobecquerel : prefixed_unit {}; struct attobecquerel : prefixed_unit {}; diff --git a/src/systems/si/include/units/isq/si/resistance.h b/src/systems/si/include/units/isq/si/resistance.h index 83d3fca0..ea57ed61 100644 --- a/src/systems/si/include/units/isq/si/resistance.h +++ b/src/systems/si/include/units/isq/si/resistance.h @@ -36,7 +36,7 @@ namespace units::isq::si { -struct ohm : named_unit {}; +struct ohm : named_unit {}; struct yoctoohm : prefixed_unit {}; struct zeptoohm : prefixed_unit {}; struct attoohm : prefixed_unit {}; diff --git a/src/systems/si/include/units/isq/si/thermodynamic_temperature.h b/src/systems/si/include/units/isq/si/thermodynamic_temperature.h index 04e81c35..cc0e3206 100644 --- a/src/systems/si/include/units/isq/si/thermodynamic_temperature.h +++ b/src/systems/si/include/units/isq/si/thermodynamic_temperature.h @@ -34,7 +34,7 @@ namespace units::isq::si { -struct kelvin : named_unit {}; +struct kelvin : named_unit {}; struct dim_thermodynamic_temperature : isq::dim_thermodynamic_temperature {}; diff --git a/src/systems/si/include/units/isq/si/time.h b/src/systems/si/include/units/isq/si/time.h index 7c1d4d5c..7c855957 100644 --- a/src/systems/si/include/units/isq/si/time.h +++ b/src/systems/si/include/units/isq/si/time.h @@ -34,7 +34,7 @@ namespace units::isq::si { -struct second : named_unit {}; +struct second : named_unit {}; struct yoctosecond : prefixed_unit {}; struct zeptosecond : prefixed_unit {}; struct attosecond : prefixed_unit {}; @@ -43,9 +43,9 @@ struct picosecond : prefixed_unit {}; struct nanosecond : prefixed_unit {}; struct microsecond : prefixed_unit {}; struct millisecond : prefixed_unit {}; -struct minute : named_scaled_unit {}; -struct hour : named_scaled_unit {}; -struct day : named_scaled_unit {}; +struct minute : named_scaled_unit {}; +struct hour : named_scaled_unit {}; +struct day : named_scaled_unit {}; struct dim_time : isq::dim_time {}; diff --git a/src/systems/si/include/units/isq/si/voltage.h b/src/systems/si/include/units/isq/si/voltage.h index 31922688..e06cc1be 100644 --- a/src/systems/si/include/units/isq/si/voltage.h +++ b/src/systems/si/include/units/isq/si/voltage.h @@ -36,7 +36,7 @@ namespace units::isq::si { -struct volt : named_unit {}; +struct volt : named_unit {}; struct yoctovolt : prefixed_unit {}; struct zeptovolt : prefixed_unit {}; struct attovolt : prefixed_unit {}; diff --git a/src/systems/si/include/units/isq/si/volume.h b/src/systems/si/include/units/isq/si/volume.h index a1f77b6e..d85c4f43 100644 --- a/src/systems/si/include/units/isq/si/volume.h +++ b/src/systems/si/include/units/isq/si/volume.h @@ -58,7 +58,7 @@ struct cubic_exametre : derived_deduced_unit {}; struct cubic_yottametre : derived_deduced_unit {}; -struct litre : alias_unit {}; +struct litre : alias_unit {}; struct yoctolitre : prefixed_alias_unit {}; struct zeptolitre : prefixed_unit {}; struct attolitre : prefixed_unit {}; diff --git a/test/unit_test/static/concepts_test.cpp b/test/unit_test/static/concepts_test.cpp index d1c1e2bf..b0e62788 100644 --- a/test/unit_test/static/concepts_test.cpp +++ b/test/unit_test/static/concepts_test.cpp @@ -42,15 +42,9 @@ namespace { using namespace units; using namespace units::isq; -// Prefix family - -static_assert(PrefixFamily); -static_assert(!PrefixFamily); - // Prefix static_assert(Prefix); -static_assert(!Prefix); static_assert(!Prefix); // UnitRatio @@ -92,6 +86,13 @@ static_assert(!Unit); static_assert(!Unit); static_assert(!Unit); +// NamedUnit + +static_assert(NamedUnit); +static_assert(NamedUnit); +static_assert(NamedUnit); +static_assert(!NamedUnit); + // UnitOf static_assert(UnitOf); diff --git a/test/unit_test/static/dimension_op_test.cpp b/test/unit_test/static/dimension_op_test.cpp index 61de01f9..fe1561cb 100644 --- a/test/unit_test/static/dimension_op_test.cpp +++ b/test/unit_test/static/dimension_op_test.cpp @@ -30,13 +30,13 @@ using namespace units; namespace { -struct u0 : named_unit {}; +struct u0 : named_unit {}; struct d0 : base_dimension<"d0", u0> {}; -struct u1 : named_unit {}; +struct u1 : named_unit {}; struct d1 : base_dimension<"d1", u1> {}; -struct u2 : named_unit {}; +struct u2 : named_unit {}; struct d2 : base_dimension<"d2", u2> {}; -struct u3 : named_unit {}; +struct u3 : named_unit {}; struct d3 : base_dimension<"d3", u3> {}; // exponent_invert diff --git a/test/unit_test/static/type_list_test.cpp b/test/unit_test/static/type_list_test.cpp index 186e0ba0..81f39586 100644 --- a/test/unit_test/static/type_list_test.cpp +++ b/test/unit_test/static/type_list_test.cpp @@ -94,9 +94,9 @@ static_assert( is_same_v>::second_list, type_list>); // type_list_merge_sorted -struct u0 : named_unit {}; +struct u0 : named_unit {}; struct d0 : base_dimension<"d0", u0> {}; -struct u1 : named_unit {}; +struct u1 : named_unit {}; struct d1 : base_dimension<"d1", u1> {}; static_assert( diff --git a/test/unit_test/static/unit_test.cpp b/test/unit_test/static/unit_test.cpp index ddd97b88..6a22b013 100644 --- a/test/unit_test/static/unit_test.cpp +++ b/test/unit_test/static/unit_test.cpp @@ -33,22 +33,22 @@ namespace { using namespace units; using namespace units::isq; -struct metre : named_unit {}; +struct metre : named_unit {}; struct centimetre : prefixed_unit {}; struct kilometre : prefixed_unit {}; -struct yard : named_scaled_unit {}; -struct foot : named_scaled_unit {}; +struct yard : named_scaled_unit {}; +struct foot : named_scaled_unit {}; struct dim_length : base_dimension<"length", metre> {}; -struct second : named_unit {}; -struct hour : named_scaled_unit {}; +struct second : named_unit {}; +struct hour : named_scaled_unit {}; struct dim_time : base_dimension<"time", second> {}; -struct kelvin : named_unit {}; +struct kelvin : named_unit {}; #if !UNITS_COMP_MSVC static_assert([](P) { - return !requires { typename prefixed_unit; }; + return !requires { typename prefixed_unit; }; }(si::kilo{})); // no prefix allowed #endif