From c7006f8813e7778f619f7d09bf988c2cea5eed2c Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Sun, 1 Dec 2024 13:45:34 +0100 Subject: [PATCH] refactor: repeated concept checks removed from `get_common_reference` --- src/core/include/mp-units/framework/reference.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/core/include/mp-units/framework/reference.h b/src/core/include/mp-units/framework/reference.h index ee9f1ad2..d4af7fba 100644 --- a/src/core/include/mp-units/framework/reference.h +++ b/src/core/include/mp-units/framework/reference.h @@ -287,10 +287,8 @@ constexpr auto operator/(R, Q&& q) = delete; [[nodiscard]] consteval AssociatedUnit auto get_common_reference(AssociatedUnit auto u1, AssociatedUnit auto u2, AssociatedUnit auto... rest) requires requires { - { - get_common_quantity_spec(get_quantity_spec(u1), get_quantity_spec(u2), get_quantity_spec(rest)...) - } -> QuantitySpec; - { get_common_unit(u1, u2, rest...) } -> AssociatedUnit; + get_common_quantity_spec(get_quantity_spec(u1), get_quantity_spec(u2), get_quantity_spec(rest)...); + get_common_unit(u1, u2, rest...); } { return get_common_unit(u1, u2, rest...); @@ -299,10 +297,8 @@ constexpr auto operator/(R, Q&& q) = delete; template [[nodiscard]] consteval Reference auto get_common_reference(R1 r1, R2 r2, Rest... rest) requires(!(AssociatedUnit && AssociatedUnit && (... && AssociatedUnit))) && requires { - { - 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; + get_common_quantity_spec(get_quantity_spec(r1), get_quantity_spec(r2), get_quantity_spec(rest)...); + get_common_unit(get_unit(r1), get_unit(r2), get_unit(rest)...); } { return detail::reference_t