mp_units::quantity::quantity¶
Construct from quantity
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¶
| Name | Description |
|---|---|
| q | The object to copy construct from |