diff --git a/src/core/include/units/concepts.h b/src/core/include/units/concepts.h index eb9330a1..5a909819 100644 --- a/src/core/include/units/concepts.h +++ b/src/core/include/units/concepts.h @@ -101,22 +101,25 @@ inline constexpr bool is_quantity> = true; } // namespace detail /** - * @brief A concept matching all quantities with provided dimension + * @brief A concept matching all quantities with provided dimension or reference * - * Satisfied by all quantities with a dimension being the instantiation derived from - * the provided dimension type. + * Satisfied by all quantities with a dimension/reference being the instantiation derived from + * the provided dimension/reference type. */ -template -concept quantity_of = Quantity && Dimension> && (Q::dimension == D); +template +concept quantity_of = Quantity && ((Dimension> && Q::dimension == V) || + (Reference> && Q::reference == V)); /** * @brief A concept matching all quantities with provided dimension or reference * - * Satisfied by all quantities with a dimension being the instantiation derived from - * the provided dimension type. + * Satisfied by all quantities with a dimension/reference being the instantiation derived from + * the provided dimension/reference type. */ -template -concept weak_quantity_of = Quantity && Dimension> && - (interconvertible(Q::dimension, D)); +template +concept weak_quantity_of = Quantity && + ((Dimension> && interconvertible(Q::dimension, V)) || + (Reference> && + interconvertible(Q::dimension, V.dimension) && Q::unit == V.unit)); } // namespace units