Constructs a quantity from a numerical value and a reference with a different unit.
Synopsis
Declared in <mp‐units/framework/quantity.h>
template<
typename FwdValue,
Reference R2>
requires (!equivalent(unit, get_unit(R2{}))) &&
detail::QuantityConstructibleFrom<quantity, quantity<R2{}, std::remove_cvref_t<FwdValue>>>
[[nodiscard]]
constexpr
quantity(
FwdValue&& val,
R2 ref);
Description
The value is first converted to the quantity of reference ref and then scaled to this quantity's unit.
Return Value
|
Note
|
The return value should not be discarded. |
Parameters
Name |
Description |
val |
the numerical value to store, expressed in the unit of |
ref |
a reference whose unit is not equivalent to |
Created with MrDocs