mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-31 10:57:16 +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 {
|
struct point_origin_interface {
|
||||||
template<PointOrigin PO, typename FwdQ, QuantityOf<PO::_quantity_spec_> Q = std::remove_cvref_t<FwdQ>>
|
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>
|
[[nodiscard]] friend constexpr QuantityPoint auto operator+(PO po, FwdQ&& q)
|
||||||
operator+(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>>
|
template<Quantity FwdQ, PointOrigin PO,
|
||||||
[[nodiscard]] friend constexpr quantity_point<Q::reference, MP_UNITS_EXPRESSION_WORKAROUND(PO{}), typename Q::rep>
|
QuantityOf<detail::get_delta_quantity_spec(PO::_quantity_spec_)> Q = std::remove_cvref_t<FwdQ>>
|
||||||
operator+(FwdQ&& q, PO po)
|
[[nodiscard]] friend constexpr QuantityPoint auto operator+(FwdQ&& q, PO po)
|
||||||
{
|
{
|
||||||
return po + std::forward<FwdQ>(q);
|
return po + std::forward<FwdQ>(q);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user