mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-30 18:37:15 +02:00
refactor: point_origin_interface::op+
return type unified with the rest of the interfaces
This commit is contained in:
@ -63,15 +63,14 @@ template<typename FwdQ, PointOrigin PO,
|
||||
|
||||
struct point_origin_interface {
|
||||
template<PointOrigin PO, typename FwdQ, QuantityOf<PO::_quantity_spec_> Q = std::remove_cvref_t<FwdQ>>
|
||||
[[nodiscard]] friend constexpr quantity_point<Q::reference, MP_UNITS_EXPRESSION_WORKAROUND(PO{}), typename Q::rep>
|
||||
operator+(PO, FwdQ&& q)
|
||||
[[nodiscard]] friend constexpr QuantityPoint auto operator+(PO po, FwdQ&& q)
|
||||
{
|
||||
return quantity_point{std::forward<FwdQ>(q), PO{}};
|
||||
return quantity_point{std::forward<FwdQ>(q), po};
|
||||
}
|
||||
|
||||
template<Quantity FwdQ, PointOrigin PO, QuantityOf<PO::_quantity_spec_> Q = std::remove_cvref_t<FwdQ>>
|
||||
[[nodiscard]] friend constexpr quantity_point<Q::reference, MP_UNITS_EXPRESSION_WORKAROUND(PO{}), typename Q::rep>
|
||||
operator+(FwdQ&& q, PO po)
|
||||
template<Quantity FwdQ, PointOrigin PO,
|
||||
QuantityOf<detail::get_delta_quantity_spec(PO::_quantity_spec_)> Q = std::remove_cvref_t<FwdQ>>
|
||||
[[nodiscard]] friend constexpr QuantityPoint auto operator+(FwdQ&& q, PO po)
|
||||
{
|
||||
return po + std::forward<FwdQ>(q);
|
||||
}
|
||||
|
Reference in New Issue
Block a user