A quantity point

Synopsis

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

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

Description

An absolute quantity measured from an origin.

Base Classes

Name

Description

/* implementation-defined */

Type Aliases

Name

Description

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

Name

Description

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

Name

Description

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

Name

Description

quantity_from_origin_is_an_implementation_detail_

needs to be public for a structural type

Static Data Members

Name

Description

absolute_point_origin

The absolute point origin underlying point_originpoint_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

Name

Description

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

Name

Description

absolute

Constructs a quantity_point of reference R from a raw representation value

ceil

Computes the smallest quantity point with integer representation and unit type To with its number not less than qp

floor

Computes the largest quantity point with integer representation and unit type To with its number not greater than qp

isfinite

Determines if a quantity point is finite.

isinf

Determines if a quantity point is infinite.

isnan

Determines if a quantity point is a nan.

lerp

Linear interpolation or extrapolation

midpoint

Computes the midpoint of two points

point

Constructs a quantity_point of reference R from a raw representation value

round

Computes the nearest quantity point with integer representation and unit type To to qp

value_cast

Explicit cast of a quantity point's representation type

Template Parameters

Name

Description

R

a reference of the quantity point providing all information about quantity properties

PO

a type that represents the origin point from which the quantity point is measured from

Rep

a type to be used to represent values of a quantity point

Created with MrDocs