mp_units::reference

Quantity reference type

Synopsis

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

template<
    QuantitySpec Q,
    Unit U>
struct reference;

Description

Quantity reference describes all the properties of a quantity besides its representation type.

In most cases this class template is not explicitly instantiated by the user. It is implicitly instantiated by the library's framework while binding a quantity specification with a compatible unit.


Reference auto kmph = isq::speed[km / h];
QuantityOf<isq::speed[km / h]> auto speed = 90 * kmph;

The following syntaxes are not allowed: 2 / kmph, kmph * 3, kmph / 4, 70 * isq::length[km]/ isq:time[h].

Friends

NameDescription
mp_units::cbrtComputes the cubic root of a reference
mp_units::sqrtComputes the square root of a reference
mp_units::powComputes the value of a reference raised to the Num/Den power
mp_units::inverseComputes the inverse of a reference
mp_units::operator/Divides a unit by a reference
mp_units::operator/Divides a reference by a unit
mp_units::operator/Divides a reference by another reference
mp_units::operator*Multiplies a unit by a reference
mp_units::operator*Multiplies a reference by a unit
mp_units::operator*Multiplies two references
mp_units::operator==Checks whether a reference is equal to a unit
mp_units::operator==Checks whether two references are equal
mp_units::get_unitReturns the unit of a reference
mp_units::get_quantity_specReturns the quantity specification of a reference whose Q is marked final
mp_units::get_quantity_specReturns the quantity specification of a reference