From dcab80525df2b7d46f16935a6f4795d96f721839 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 24 Sep 2024 09:36:59 +0200 Subject: [PATCH] refactor: :boom: `common_XXX()` functions renamed to `get_common_XXX()` This is needed to release a name for `common_unit` type that is coming soon. --- .../framework_basics/systems_of_quantities.md | 6 +-- example/kalman_filter/kalman.h | 4 +- .../include/mp-units/framework/quantity.h | 10 ++-- .../mp-units/framework/quantity_spec.h | 12 ++--- .../include/mp-units/framework/reference.h | 26 +++++----- src/core/include/mp-units/framework/unit.h | 10 ++-- src/core/include/mp-units/math.h | 36 +++++++------- .../include/mp-units/systems/angular/math.h | 4 +- .../include/mp-units/systems/si/math.h | 4 +- test/static/quantity_point_test.cpp | 8 +-- test/static/quantity_spec_test.cpp | 44 ++++++++--------- test/static/reference_test.cpp | 22 ++++----- test/static/unit_test.cpp | 49 ++++++++++--------- 13 files changed, 120 insertions(+), 115 deletions(-) diff --git a/docs/users_guide/framework_basics/systems_of_quantities.md b/docs/users_guide/framework_basics/systems_of_quantities.md index 6f0b1ec3..1fc5934c 100644 --- a/docs/users_guide/framework_basics/systems_of_quantities.md +++ b/docs/users_guide/framework_basics/systems_of_quantities.md @@ -229,9 +229,9 @@ where the result of `length` is known as a **common quantity** type. A result of the first common node in a hierarchy tree of the same kind. For example: ```cpp -static_assert(common_quantity_spec(isq::width, isq::height) == isq::length); -static_assert(common_quantity_spec(isq::thickness, isq::radius) == isq::width); -static_assert(common_quantity_spec(isq::distance, isq::path_length) == isq::path_length); +static_assert(get_common_quantity_spec(isq::width, isq::height) == isq::length); +static_assert(get_common_quantity_spec(isq::thickness, isq::radius) == isq::width); +static_assert(get_common_quantity_spec(isq::distance, isq::path_length) == isq::path_length); ``` diff --git a/example/kalman_filter/kalman.h b/example/kalman_filter/kalman.h index 90d0d506..789a5ece 100644 --- a/example/kalman_filter/kalman.h +++ b/example/kalman_filter/kalman.h @@ -108,7 +108,7 @@ public: // kalman gain template - requires requires { mp_units::common_reference(Q1::reference, Q2::reference); } + requires requires { mp_units::get_common_reference(Q1::reference, Q2::reference); } [[nodiscard]] constexpr mp_units::quantity kalman_gain( Q1 variance_in_estimate, Q2 variance_in_measurement) { @@ -185,7 +185,7 @@ template - requires requires { mp_units::common_reference(Q1::reference, Q2::reference); } + requires requires { mp_units::get_common_reference(Q1::reference, Q2::reference); } [[nodiscard]] constexpr mp_units::Quantity auto covariance_extrapolation(Q1 uncertainty, Q2 process_noise_variance) { return uncertainty + process_noise_variance; diff --git a/src/core/include/mp-units/framework/quantity.h b/src/core/include/mp-units/framework/quantity.h index 03088ba8..ffb04edc 100644 --- a/src/core/include/mp-units/framework/quantity.h +++ b/src/core/include/mp-units/framework/quantity.h @@ -88,7 +88,7 @@ concept InvocableQuantities = // TODO remove the following when clang diagnostics improve // https://github.com/llvm/llvm-project/issues/96660 template -concept HaveCommonReferenceImpl = requires { common_reference(R1, R2); }; +concept HaveCommonReferenceImpl = requires { get_common_reference(R1, R2); }; template concept HaveCommonReference = HaveCommonReferenceImpl; @@ -96,11 +96,11 @@ concept HaveCommonReference = HaveCommonReferenceImpl; template concept CommonlyInvocableQuantities = Quantity && Quantity && HaveCommonReference && - InvocableQuantities; + InvocableQuantities; template requires CommonlyInvocableQuantities -using common_quantity_for = quantity>; template @@ -645,11 +645,11 @@ MP_UNITS_EXPORT_END template requires requires { - { mp_units::common_reference(Q1::reference, Q2::reference) } -> mp_units::Reference; + { mp_units::get_common_reference(Q1::reference, Q2::reference) } -> mp_units::Reference; typename std::common_type_t; } struct std::common_type { - using type = mp_units::quantity>; }; diff --git a/src/core/include/mp-units/framework/quantity_spec.h b/src/core/include/mp-units/framework/quantity_spec.h index 7672ba02..3de958af 100644 --- a/src/core/include/mp-units/framework/quantity_spec.h +++ b/src/core/include/mp-units/framework/quantity_spec.h @@ -1497,12 +1497,12 @@ template return kind_of; } -[[nodiscard]] consteval QuantitySpec auto common_quantity_spec(QuantitySpec auto q) { return q; } +[[nodiscard]] consteval QuantitySpec auto get_common_quantity_spec(QuantitySpec auto q) { return q; } template requires detail::QuantitySpecConvertibleTo || detail::QuantitySpecConvertibleTo -[[nodiscard]] consteval QuantitySpec auto common_quantity_spec(Q1 q1, Q2 q2) +[[nodiscard]] consteval QuantitySpec auto get_common_quantity_spec(Q1 q1, Q2 q2) { using QQ1 = decltype(detail::remove_kind(q1)); using QQ2 = decltype(detail::remove_kind(q2)); @@ -1535,11 +1535,11 @@ template // NOLINTEND(bugprone-branch-clone) } -[[nodiscard]] consteval QuantitySpec auto common_quantity_spec(QuantitySpec auto q1, QuantitySpec auto q2, - QuantitySpec auto q3, QuantitySpec auto... rest) - requires requires { common_quantity_spec(common_quantity_spec(q1, q2), q3, rest...); } +[[nodiscard]] consteval QuantitySpec auto get_common_quantity_spec(QuantitySpec auto q1, QuantitySpec auto q2, + QuantitySpec auto q3, QuantitySpec auto... rest) + requires requires { get_common_quantity_spec(get_common_quantity_spec(q1, q2), q3, rest...); } { - return common_quantity_spec(common_quantity_spec(q1, q2), q3, rest...); + return get_common_quantity_spec(get_common_quantity_spec(q1, q2), q3, rest...); } MP_UNITS_EXPORT_END diff --git a/src/core/include/mp-units/framework/reference.h b/src/core/include/mp-units/framework/reference.h index e926a1e2..d74c5cc8 100644 --- a/src/core/include/mp-units/framework/reference.h +++ b/src/core/include/mp-units/framework/reference.h @@ -268,26 +268,30 @@ template // NOLINTNEXTLINE(cppcoreguidelines-missing-std-forward) constexpr auto operator/(R, Q&& q) = delete; -[[nodiscard]] consteval AssociatedUnit auto common_reference(AssociatedUnit auto u1, AssociatedUnit auto u2, - AssociatedUnit auto... rest) +[[nodiscard]] consteval AssociatedUnit auto get_common_reference(AssociatedUnit auto u1, AssociatedUnit auto u2, + AssociatedUnit auto... rest) requires requires { - { common_quantity_spec(get_quantity_spec(u1), get_quantity_spec(u2), get_quantity_spec(rest)...) } -> QuantitySpec; - { common_unit(u1, u2, rest...) } -> AssociatedUnit; + { + get_common_quantity_spec(get_quantity_spec(u1), get_quantity_spec(u2), get_quantity_spec(rest)...) + } -> QuantitySpec; + { get_common_unit(u1, u2, rest...) } -> AssociatedUnit; } { - return common_unit(u1, u2, rest...); + return get_common_unit(u1, u2, rest...); } template -[[nodiscard]] consteval Reference auto common_reference(R1 r1, R2 r2, Rest... rest) +[[nodiscard]] consteval Reference auto get_common_reference(R1 r1, R2 r2, Rest... rest) requires(!(AssociatedUnit && AssociatedUnit && (... && AssociatedUnit))) && requires { - { common_quantity_spec(get_quantity_spec(r1), get_quantity_spec(r2), get_quantity_spec(rest)...) } -> QuantitySpec; - { common_unit(get_unit(r1), get_unit(r2), get_unit(rest)...) } -> Unit; + { + get_common_quantity_spec(get_quantity_spec(r1), get_quantity_spec(r2), get_quantity_spec(rest)...) + } -> QuantitySpec; + { get_common_unit(get_unit(r1), get_unit(r2), get_unit(rest)...) } -> Unit; } { - return detail::reference_t{}; + return detail::reference_t{}; } MP_UNITS_EXPORT_END diff --git a/src/core/include/mp-units/framework/unit.h b/src/core/include/mp-units/framework/unit.h index 4446ec3b..ed79be9d 100644 --- a/src/core/include/mp-units/framework/unit.h +++ b/src/core/include/mp-units/framework/unit.h @@ -623,11 +623,11 @@ template } // Common unit -[[nodiscard]] consteval Unit auto common_unit(Unit auto u) { return u; } +[[nodiscard]] consteval Unit auto get_common_unit(Unit auto u) { return u; } template requires(convertible(U1{}, U2{})) -[[nodiscard]] consteval Unit auto common_unit(U1 u1, U2 u2) +[[nodiscard]] consteval Unit auto get_common_unit(U1 u1, U2 u2) { if constexpr (is_same_v) return u1; @@ -654,10 +654,10 @@ template } } -[[nodiscard]] consteval Unit auto common_unit(Unit auto u1, Unit auto u2, Unit auto u3, Unit auto... rest) - requires requires { common_unit(common_unit(u1, u2), u3, rest...); } +[[nodiscard]] consteval Unit auto get_common_unit(Unit auto u1, Unit auto u2, Unit auto u3, Unit auto... rest) + requires requires { get_common_unit(get_common_unit(u1, u2), u3, rest...); } { - return common_unit(common_unit(u1, u2), u3, rest...); + return get_common_unit(get_common_unit(u1, u2), u3, rest...); } diff --git a/src/core/include/mp-units/math.h b/src/core/include/mp-units/math.h index 830d8d0a..0feb9624 100644 --- a/src/core/include/mp-units/math.h +++ b/src/core/include/mp-units/math.h @@ -228,11 +228,11 @@ template * @return Quantity: The nearest floating point representable to ax+b */ template - requires requires { common_quantity_spec(get_quantity_spec(R) * get_quantity_spec(S), get_quantity_spec(T)); } && + requires requires { get_common_quantity_spec(get_quantity_spec(R) * get_quantity_spec(S), get_quantity_spec(T)); } && (get_unit(R) * get_unit(S) == get_unit(T)) && requires(Rep1 v1, Rep2 v2, Rep3 v3) { requires requires { fma(v1, v2, v3); } || requires { std::fma(v1, v2, v3); }; } -[[nodiscard]] constexpr QuantityOf auto fma(const quantity& a, const quantity& x, const quantity& b) noexcept @@ -240,7 +240,7 @@ template using std::fma; return quantity{ fma(a.numerical_value_ref_in(a.unit), x.numerical_value_ref_in(x.unit), b.numerical_value_ref_in(b.unit)), - common_reference(R * S, T)}; + get_common_reference(R * S, T)}; } /** @@ -252,19 +252,19 @@ template * @return QuantityPoint: The nearest floating point representable to ax+b */ template - requires requires { common_quantity_spec(get_quantity_spec(R) * get_quantity_spec(S), get_quantity_spec(T)); } && + requires requires { get_common_quantity_spec(get_quantity_spec(R) * get_quantity_spec(S), get_quantity_spec(T)); } && (get_unit(R) * get_unit(S) == get_unit(T)) && requires(Rep1 v1, Rep2 v2, Rep3 v3) { requires requires { fma(v1, v2, v3); } || requires { std::fma(v1, v2, v3); }; } [[nodiscard]] constexpr QuantityPointOf< - common_quantity_spec(get_quantity_spec(R) * get_quantity_spec(S), - get_quantity_spec(T))> auto fma(const quantity& a, const quantity& x, - const quantity_point& b) noexcept + get_common_quantity_spec(get_quantity_spec(R) * get_quantity_spec(S), + get_quantity_spec(T))> auto fma(const quantity& a, const quantity& x, + const quantity_point& b) noexcept { using std::fma; return Origin + quantity{fma(a.numerical_value_ref_in(a.unit), x.numerical_value_ref_in(x.unit), b.quantity_ref_from(b.point_origin).numerical_value_ref_in(b.unit)), - common_reference(R * S, T)}; + get_common_reference(R * S, T)}; } /** @@ -272,13 +272,13 @@ template requires requires(Rep1 v1, Rep2 v2) { - common_reference(R1, R2); + get_common_reference(R1, R2); requires requires { fmod(v1, v2); } || requires { std::fmod(v1, v2); }; } [[nodiscard]] constexpr QuantityOf auto fmod(const quantity& x, const quantity& y) noexcept { - constexpr auto ref = common_reference(R1, R2); + constexpr auto ref = get_common_reference(R1, R2); constexpr auto unit = get_unit(ref); using std::fmod; return quantity{fmod(x.numerical_value_in(unit), y.numerical_value_in(unit)), ref}; @@ -289,13 +289,13 @@ template */ template requires requires(Rep1 v1, Rep2 v2) { - common_reference(R1, R2); + get_common_reference(R1, R2); requires requires { remainder(v1, v2); } || requires { std::remainder(v1, v2); }; } [[nodiscard]] constexpr QuantityOf auto remainder(const quantity& x, const quantity& y) noexcept { - constexpr auto ref = common_reference(R1, R2); + constexpr auto ref = get_common_reference(R1, R2); constexpr auto unit = get_unit(ref); using std::remainder; return quantity{remainder(x.numerical_value_in(unit), y.numerical_value_in(unit)), ref}; @@ -451,13 +451,13 @@ template */ template requires requires(Rep1 v1, Rep2 v2) { - common_reference(R1, R2); + get_common_reference(R1, R2); requires requires { hypot(v1, v2); } || requires { std::hypot(v1, v2); }; } -[[nodiscard]] constexpr QuantityOf auto hypot( +[[nodiscard]] constexpr QuantityOf auto hypot( const quantity& x, const quantity& y) noexcept { - constexpr auto ref = common_reference(R1, R2); + constexpr auto ref = get_common_reference(R1, R2); constexpr auto unit = get_unit(ref); using std::hypot; return quantity{hypot(x.numerical_value_in(unit), y.numerical_value_in(unit)), ref}; @@ -469,13 +469,13 @@ template */ template requires requires(Rep1 v1, Rep2 v2, Rep3 v3) { - common_reference(R1, R2, R3); + get_common_reference(R1, R2, R3); requires requires { hypot(v1, v2, v3); } || requires { std::hypot(v1, v2, v3); }; } -[[nodiscard]] constexpr QuantityOf auto hypot( +[[nodiscard]] constexpr QuantityOf auto hypot( const quantity& x, const quantity& y, const quantity& z) noexcept { - constexpr auto ref = common_reference(R1, R2); + constexpr auto ref = get_common_reference(R1, R2); constexpr auto unit = get_unit(ref); using std::hypot; return quantity{hypot(x.numerical_value_in(unit), y.numerical_value_in(unit), z.numerical_value_in(unit)), ref}; diff --git a/src/systems/include/mp-units/systems/angular/math.h b/src/systems/include/mp-units/systems/angular/math.h index f6a7a0fa..7c5de757 100644 --- a/src/systems/include/mp-units/systems/angular/math.h +++ b/src/systems/include/mp-units/systems/angular/math.h @@ -129,12 +129,12 @@ template auto R, typename Rep> template requires requires(Rep1 v1, Rep2 v2) { - common_reference(R1, R2); + get_common_reference(R1, R2); requires requires { atan2(v1, v2); } || requires { std::atan2(v1, v2); }; } [[nodiscard]] inline QuantityOf auto atan2(const quantity& y, const quantity& x) noexcept { - constexpr auto ref = common_reference(R1, R2); + constexpr auto ref = get_common_reference(R1, R2); constexpr auto unit = get_unit(ref); using std::atan2; if constexpr (!treat_as_floating_point || !treat_as_floating_point) { diff --git a/src/systems/include/mp-units/systems/si/math.h b/src/systems/include/mp-units/systems/si/math.h index 80568e37..c94bd6e6 100644 --- a/src/systems/include/mp-units/systems/si/math.h +++ b/src/systems/include/mp-units/systems/si/math.h @@ -132,13 +132,13 @@ template auto R, typename Rep> template requires requires(Rep1 v1, Rep2 v2) { - common_reference(R1, R2); + get_common_reference(R1, R2); requires requires { atan2(v1, v2); } || requires { std::atan2(v1, v2); }; } [[nodiscard]] inline QuantityOf auto atan2( const quantity& y, const quantity& x) noexcept { - constexpr auto ref = common_reference(R1, R2); + constexpr auto ref = get_common_reference(R1, R2); constexpr auto unit = get_unit(ref); using std::atan2; if constexpr (!treat_as_floating_point || !treat_as_floating_point) { diff --git a/test/static/quantity_point_test.cpp b/test/static/quantity_point_test.cpp index 2a86878a..6054cd2f 100644 --- a/test/static/quantity_point_test.cpp +++ b/test/static/quantity_point_test.cpp @@ -437,7 +437,7 @@ static_assert(!std::convertible_to, quantity_point, quantity>); static_assert(!std::convertible_to, quantity_point>); -// quantity_specs with common_quantity_spec +// quantity_specs with get_common_quantity_spec static_assert(!std::constructible_from, quantity>); static_assert(!std::convertible_to, quantity_point>); @@ -485,7 +485,7 @@ static_assert(!std::convertible_to, quantity_point, quantity>); static_assert(!std::convertible_to, quantity_point>); -// quantity_specs with common_quantity_spec +// quantity_specs with get_common_quantity_spec static_assert(!std::constructible_from, quantity>); static_assert(!std::convertible_to, quantity_point>); @@ -560,7 +560,7 @@ static_assert(!std::convertible_to, quantity_poin static_assert(!std::constructible_from, quantity_point>); static_assert(!std::convertible_to, quantity_point>); -// quantity_specs with common_quantity_spec +// quantity_specs with get_common_quantity_spec static_assert(!std::constructible_from, quantity_point>); static_assert(!std::convertible_to, quantity_point>); @@ -687,7 +687,7 @@ static_assert(std::constructible_from, quantity_point>); -// quantity_specs with common_quantity_spec +// quantity_specs with get_common_quantity_spec static_assert(!std::constructible_from, quantity_point>); static_assert( diff --git a/test/static/quantity_spec_test.cpp b/test/static/quantity_spec_test.cpp index ee4e86a8..13ca2863 100644 --- a/test/static/quantity_spec_test.cpp +++ b/test/static/quantity_spec_test.cpp @@ -783,35 +783,35 @@ static_assert((position_vector / time).character == quantity_character::vector); static_assert((position_vector / position_vector * time).character == quantity_character::scalar); static_assert((velocity / acceleration).character == quantity_character::scalar); -// common_quantity_spec -static_assert(common_quantity_spec(length, length) == length); -static_assert(common_quantity_spec(kind_of, kind_of) == kind_of); -static_assert(common_quantity_spec(kind_of, length) == length); -static_assert(common_quantity_spec(length, kind_of) == length); -static_assert(common_quantity_spec(width, kind_of) == width); -static_assert(common_quantity_spec(kind_of, width) == width); +// get_common_quantity_spec +static_assert(get_common_quantity_spec(length, length) == length); +static_assert(get_common_quantity_spec(kind_of, kind_of) == kind_of); +static_assert(get_common_quantity_spec(kind_of, length) == length); +static_assert(get_common_quantity_spec(length, kind_of) == length); +static_assert(get_common_quantity_spec(width, kind_of) == width); +static_assert(get_common_quantity_spec(kind_of, width) == width); -static_assert(common_quantity_spec(width, height) == length); -static_assert(common_quantity_spec(distance, path_length) == path_length); -static_assert(common_quantity_spec(potential_energy, kinetic_energy) == mechanical_energy); +static_assert(get_common_quantity_spec(width, height) == length); +static_assert(get_common_quantity_spec(distance, path_length) == path_length); +static_assert(get_common_quantity_spec(potential_energy, kinetic_energy) == mechanical_energy); -static_assert(common_quantity_spec(length / time, length / time) == length / time); -static_assert(common_quantity_spec(length / time, inverse(time / length)) == length / time); +static_assert(get_common_quantity_spec(length / time, length / time) == length / time); +static_assert(get_common_quantity_spec(length / time, inverse(time / length)) == length / time); -static_assert(common_quantity_spec(speed, length / time) == speed); -static_assert(common_quantity_spec(length / time, speed) == speed); -static_assert(common_quantity_spec(area, length* length) == area); -static_assert(common_quantity_spec(length * length, area) == area); -static_assert(common_quantity_spec(kinetic_energy, mass* pow<2>(length) / pow<2>(time)) == kinetic_energy); -static_assert(common_quantity_spec(mass * pow<2>(length) / pow<2>(time), kinetic_energy) == kinetic_energy); -static_assert(common_quantity_spec(gravitational_potential_energy, mass* acceleration_of_free_fall* height) == +static_assert(get_common_quantity_spec(speed, length / time) == speed); +static_assert(get_common_quantity_spec(length / time, speed) == speed); +static_assert(get_common_quantity_spec(area, length* length) == area); +static_assert(get_common_quantity_spec(length * length, area) == area); +static_assert(get_common_quantity_spec(kinetic_energy, mass* pow<2>(length) / pow<2>(time)) == kinetic_energy); +static_assert(get_common_quantity_spec(mass * pow<2>(length) / pow<2>(time), kinetic_energy) == kinetic_energy); +static_assert(get_common_quantity_spec(gravitational_potential_energy, mass* acceleration_of_free_fall* height) == gravitational_potential_energy); -static_assert(common_quantity_spec(mass * acceleration_of_free_fall * height, gravitational_potential_energy) == +static_assert(get_common_quantity_spec(mass * acceleration_of_free_fall * height, gravitational_potential_energy) == gravitational_potential_energy); -static_assert(common_quantity_spec(gravitational_potential_energy, mass* acceleration* length) == +static_assert(get_common_quantity_spec(gravitational_potential_energy, mass* acceleration* length) == mass * acceleration * length); -static_assert(common_quantity_spec(mass * acceleration * length, gravitational_potential_energy) == +static_assert(get_common_quantity_spec(mass * acceleration * length, gravitational_potential_energy) == mass * acceleration * length); template diff --git a/test/static/reference_test.cpp b/test/static/reference_test.cpp index 65abe0bb..e943827e 100644 --- a/test/static/reference_test.cpp +++ b/test/static/reference_test.cpp @@ -273,22 +273,22 @@ static_assert(invalid_unit); static_assert(invalid_unit); static_assert(invalid_unit); -static_assert(is_of_type>); -static_assert(is_of_type); -static_assert(is_of_type); -static_assert(is_of_type>); -static_assert(is_of_type>); -static_assert(is_of_type>); -static_assert(is_of_type>); +static_assert(is_of_type>); +static_assert(is_of_type); +static_assert(is_of_type); +static_assert(is_of_type>); +static_assert(is_of_type>); +static_assert(is_of_type>); +static_assert(is_of_type>); static_assert( - is_of_type>); + is_of_type>); static_assert( - is_of_type>); + is_of_type>); template concept no_common_reference = requires { - requires !requires { common_reference(R1, R2); }; - requires !requires { common_reference(R2, R1); }; + requires !requires { get_common_reference(R1, R2); }; + requires !requires { get_common_reference(R2, R1); }; }; static_assert(no_common_reference); diff --git a/test/static/unit_test.cpp b/test/static/unit_test.cpp index 33cf200b..9b417ea0 100644 --- a/test/static/unit_test.cpp +++ b/test/static/unit_test.cpp @@ -511,32 +511,33 @@ static_assert(is_of_type(hour), derived_unit>>); static_assert( is_of_type(mag<3600>* second), scaled_unit * mag<3600>, derived_unit>>>); -// common_unit -static_assert(is_of_type); -static_assert(is_of_type>); -static_assert(is_of_type, kilogram), si::kilo_>); -static_assert(is_of_type), si::kilo_>); -static_assert(is_of_type* gram, kilogram), si::kilo_>); -static_assert(is_of_type* gram), si::kilo_>); -static_assert(is_of_type); -static_assert(is_of_type); -static_assert(is_of_type); -static_assert(is_of_type); -static_assert(is_of_type); -static_assert(is_of_type); -static_assert(is_of_type); -static_assert(is_of_type); -static_assert(is_of_type, si::milli), si::milli_>); -static_assert(is_of_type, si::kilo), si::milli_>); -static_assert(is_of_type); -static_assert(is_of_type); +// get_common_unit +static_assert(is_of_type); +static_assert(is_of_type>); +static_assert(is_of_type, kilogram), si::kilo_>); +static_assert(is_of_type), si::kilo_>); +static_assert(is_of_type* gram, kilogram), si::kilo_>); +static_assert(is_of_type* gram), si::kilo_>); +static_assert(is_of_type); +static_assert(is_of_type); +static_assert(is_of_type); +static_assert(is_of_type); +static_assert(is_of_type); +static_assert(is_of_type); +static_assert(is_of_type); +static_assert(is_of_type); +static_assert(is_of_type, si::milli), si::milli_>); +static_assert(is_of_type, si::kilo), si::milli_>); +static_assert(is_of_type); +static_assert(is_of_type); // TODO The below have long/unreadable magnitude types -static_assert(is_of_type, derived_unit>>>); -static_assert(is_of_type, derived_unit>>>); -static_assert(is_of_type, metre_>>); -static_assert(is_of_type, metre_>>); -static_assert(is_of_type>>); +static_assert(is_of_type, metre_>>); +static_assert(is_of_type, metre_>>); +static_assert( + is_of_type>>); } // namespace