mp_units::point¶
Creates a point of reference R from a number
Synopsis¶
Declared in <mp-units/framework/construction_helpers.h>
template<Reference auto R>
constexpr /* implementation-defined */ point = {};
Description¶
point<R>(v) returns a quantity_point of reference R that holds v, measured from the default origin of R. That is the origin of its unit when the unit has one, such as si::ice_point for si::degree_Celsius, and the natural_point_origin of its quantity otherwise.
quantity_point morning = point<deg_C>(14.);
quantity_point noon = point<deg_C>(21.);
quantity warming = noon - morning; // 7 °C, a delta
Template Parameters¶
| Name | Description |
|---|---|
| R | the reference or unit of the point |
See Also¶
deltafor creating a delta from a numberdefault_point_originfor the origin a reference implies- The Affine Space for when a value is a delta and when it is a point