mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-31 10:57: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 =
|
concept ReferenceOf =
|
||||||
Reference<T> &&
|
Reference<T> &&
|
||||||
((Dimension<std::remove_const_t<decltype(V)>> && get_quantity_spec(T{}).dimension == V) ||
|
((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
|
} // namespace mp_units
|
||||||
|
Reference in New Issue
Block a user