diff --git a/src/core/include/mp_units/reference.h b/src/core/include/mp_units/reference.h index 1cf8afec..7d90287b 100644 --- a/src/core/include/mp_units/reference.h +++ b/src/core/include/mp_units/reference.h @@ -137,9 +137,12 @@ template void /*Use `q * (1 * r)` rather than `q * r`.*/ operator*(Quantity auto, Reference auto) = delete; -[[nodiscard]] consteval auto common_reference(AssociatedUnit auto u1, AssociatedUnit auto u2, - AssociatedUnit auto... rest) +[[nodiscard]] consteval AssociatedUnit auto 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; @@ -149,7 +152,7 @@ void /*Use `q * (1 * r)` rather than `q * r`.*/ operator*(Quantity auto, Referen } template -[[nodiscard]] consteval auto common_reference(R1 r1, R2 r2, Rest... rest) +[[nodiscard]] consteval Reference auto 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)...)