forked from mpusz/mp-units
fix: QuantityConvertibleTo
used in quantity_point
compound assignment
Resolves #215
This commit is contained in:
@@ -431,17 +431,19 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// compound assignment operators
|
// compound assignment operators
|
||||||
template<detail::Mutable<quantity_point> QP>
|
template<detail::Mutable<quantity_point> QP, auto R2, typename Rep2>
|
||||||
requires requires(quantity_type q) { quantity_from_origin_is_an_implementation_detail_ += q; }
|
requires detail::QuantityConvertibleTo<quantity<R2, Rep2>, quantity_type> &&
|
||||||
friend constexpr decltype(auto) operator+=(QP&& qp, const quantity_type& q)
|
requires(quantity_type q) { quantity_from_origin_is_an_implementation_detail_ += q; }
|
||||||
|
friend constexpr decltype(auto) operator+=(QP&& qp, const quantity<R2, Rep2>& q)
|
||||||
{
|
{
|
||||||
qp.quantity_from_origin_is_an_implementation_detail_ += q;
|
qp.quantity_from_origin_is_an_implementation_detail_ += q;
|
||||||
return std::forward<QP>(qp);
|
return std::forward<QP>(qp);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<detail::Mutable<quantity_point> QP>
|
template<detail::Mutable<quantity_point> QP, auto R2, typename Rep2>
|
||||||
requires requires(quantity_type q) { quantity_from_origin_is_an_implementation_detail_ -= q; }
|
requires detail::QuantityConvertibleTo<quantity<R2, Rep2>, quantity_type> &&
|
||||||
friend constexpr decltype(auto) operator-=(QP&& qp, const quantity_type& q)
|
requires(quantity_type q) { quantity_from_origin_is_an_implementation_detail_ -= q; }
|
||||||
|
friend constexpr decltype(auto) operator-=(QP&& qp, const quantity<R2, Rep2>& q)
|
||||||
{
|
{
|
||||||
qp.quantity_from_origin_is_an_implementation_detail_ -= q;
|
qp.quantity_from_origin_is_an_implementation_detail_ -= q;
|
||||||
return std::forward<QP>(qp);
|
return std::forward<QP>(qp);
|
||||||
|
Reference in New Issue
Block a user