mp_units::quantity_point

A quantity point

Synopsis

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

template<
    Reference auto R,
    PointOriginFor<get_quantity_spec(R)> auto PO = default_point_origin(R),
    RepresentationOf<get_quantity_spec(R)> Rep = double>
class quantity_point
    : public /* implementation-defined */

Description

An absolute quantity measured from an origin.

Base Classes

NameDescription
/* implementation-defined */

Type Aliases

NameDescription
quantity_type The quantity type used to store the offset of this quantity point from point_origin.
rep The type used to represent the numerical value of the quantity point.

Member Functions

NameDescription
quantity_point [constructor]Constructors
force_in [deprecated]force_in overloads
force_numerical_value_in [deprecated]Deprecated. Returns the numerical value of this quantity point on the scale of another unit, truncating if inexact.
in in overloads
numerical_value_in numerical_value_in overloads
operator++ Increment operators
operator+= Adds a quantity to the underlying quantity from the origin and assigns the result to *this.
operator-- Decrement operators
operator-= Subtracts a quantity from the underlying quantity from the origin and assigns the result to *this.
point_for point_for overloads
quantity_from quantity_from overloads
quantity_from_zero Returns the quantity separating this quantity point from the zero of its default point origin.
quantity_ref_from quantity_ref_from overloads
operator QP_ Conversion operators

Static Member Functions

NameDescription
max Returns the largest representable quantity point, honoring the point origin's bounds policy.
min Returns the smallest representable quantity point, honoring the point origin's bounds policy.
zero Returns a quantity point at point_origin, holding the representation type's zero value.

Data Members

NameDescription
quantity_from_origin_is_an_implementation_detail_ needs to be public for a structural type

Static Data Members

NameDescription
absolute_point_origin The absolute point origin underlying point_origin - point_origin itself if it already is one, otherwise the absolute origin reached by following its chain of relative point origins.
character The quantity character (tensor order and numeric field) extracted from quantity_spec.
dimension The dimension extracted from quantity_spec.
point_origin The point origin of this quantity point, as provided via the PO template parameter.
quantity_spec The quantity specification extracted from reference.
reference The reference of the quantity point, as provided via the R template parameter.
unit The unit extracted from reference.

Deduction Guides

NameDescription
quantity_point<Q::reference, PO{}, Q::rep> Deduces a quantity_point from a quantity and an explicit point origin.
quantity_point<Q::reference, default_point_origin(Q::reference), Q::rep> Deduces a quantity_point from a quantity alone, using the default point origin for its reference.
quantity_point<quantity_point_like_traits<QP>::reference, quantity_point_like_traits<QP>::point_origin, quantity_point_like_traits<QP>::rep> Deduces a quantity_point from an external quantity-point-like type via quantity_point_like_traits.

Non-Member Functions

NameDescription
absoluteConstructs a quantity_point of reference R from a raw representation value
ceilComputes the smallest quantity point with integer representation and unit type To with its number not less than qp
floorComputes the largest quantity point with integer representation and unit type To with its number not greater than qp
isfiniteDetermines if a quantity point is finite.
isinfDetermines if a quantity point is infinite.
isnanDetermines if a quantity point is a nan.
lerpLinear interpolation or extrapolation
midpointComputes the midpoint of two points
pointConstructs a quantity_point of reference R from a raw representation value
roundComputes the nearest quantity point with integer representation and unit type To to qp
value_castExplicit cast of a quantity point's representation type

Template Parameters

NameDescription
Ra reference of the quantity point providing all information about quantity properties
POa type that represents the origin point from which the quantity point is measured from
Repa type to be used to represent values of a quantity point