mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-29 18:07:16 +02:00
fix: more constraints added to ReferenceOf
to provide support for corner cases of dimensionless quantity tree
This commit is contained in:
@ -74,6 +74,9 @@ template<typename T, auto V>
|
||||
concept ReferenceOf =
|
||||
Reference<T> &&
|
||||
((Dimension<std::remove_const_t<decltype(V)>> && get_quantity_spec(T{}).dimension == V) ||
|
||||
(QuantitySpec<std::remove_const_t<decltype(V)>> && implicitly_convertible(get_quantity_spec(T{}), V)));
|
||||
(QuantitySpec<std::remove_const_t<decltype(V)>> && implicitly_convertible(get_quantity_spec(T{}), V) &&
|
||||
!detail::DerivedFromQuantityKindSpecOf<get_quantity_spec(T{}), V> &&
|
||||
(detail::QuantityKindSpec<std::remove_const_t<decltype(get_quantity_spec(T{}))>> ||
|
||||
!detail::DerivedFromQuantityKindSpecOf<V, get_quantity_spec(T{})>)));
|
||||
|
||||
} // namespace mp_units
|
||||
|
Reference in New Issue
Block a user