mp_units::quantity::quantity

Converting constructor from another quantity whose unit needs scaling to this one.

Synopsis

Declared in <mp-units/framework/quantity.h>

template<
    auto R2,
    typename Rep2>
requires detail::QuantityConstructibleFrom<quantity, quantity<R2, Rep2>> && (!equivalent(unit, get_unit(R2)))
[[nodiscard]]
constexpr
explicit(!std::convertible_to<Rep2, rep> || !mp_units::implicitly_convertible(get_quantity_spec(R2), quantity_spec) || !mp_units::implicitly_scalable<get_unit(R2), Rep2, unit, rep>)
quantity(quantity<R2, Rep2> const& q);

Return Value

NOTE

The return value should not be discarded.

Parameters

NameDescription
qthe source quantity to convert from