From 74ad0f6f68b4c2ce9abaaf73dced8c67f0bcb418 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 13 Jun 2023 17:34:37 +0300 Subject: [PATCH] fix: more constraints added to `ReferenceOf` to provide support for corner cases of dimensionless quantity tree --- src/core/include/mp-units/bits/reference_concepts.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/include/mp-units/bits/reference_concepts.h b/src/core/include/mp-units/bits/reference_concepts.h index 61cd917d..c51d2d59 100644 --- a/src/core/include/mp-units/bits/reference_concepts.h +++ b/src/core/include/mp-units/bits/reference_concepts.h @@ -74,6 +74,9 @@ template concept ReferenceOf = Reference && ((Dimension> && get_quantity_spec(T{}).dimension == V) || - (QuantitySpec> && implicitly_convertible(get_quantity_spec(T{}), V))); + (QuantitySpec> && implicitly_convertible(get_quantity_spec(T{}), V) && + !detail::DerivedFromQuantityKindSpecOf && + (detail::QuantityKindSpec> || + !detail::DerivedFromQuantityKindSpecOf))); } // namespace mp_units