Constructs a quantity from a numerical value and a reference with an equivalent unit.

Synopsis

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

template<Reference R2>
requires (equivalent(unit, get_unit(R2{})))
[[nodiscard]]
constexpr
quantity(
    rep val,
    R2 ref);

Return Value

Note

The return value should not be discarded.

Parameters

Name

Description

val

the numerical value to store

ref

a reference whose unit is equivalent to unit

Created with MrDocs