Struct Quantity

A quantity checked at compile-time for dimensional consistency.

struct Quantity(N, alias dims) ;

Constructors

NameDescription
this Creates a new quantity from another one with the same dimensions.
this Creates a new dimensionless quantity from a number

Properties

NameTypeDescription
baseUnit[get] QuantityReturns the base unit of this quantity.

Methods

NameDescription
get Implicitly convert a dimensionless value to the value type.
isConsistentWith Tests wheter this quantity has the same dimensions as another one.
opAssign Operator overloading
opBinary Operator overloading
opBinaryRight Operator overloading
opCast Cast a dimensionless quantity to a numeric type.
opCmp Operator overloading
opEquals Operator overloading
opOpAssign Operator overloading
opUnary Operator overloading
value Gets the value of this quantity when expressed in the given target unit.

Parameters

NameDescription
N the numeric type of the quantity.

See Also

QVariant has the same public members and overloaded operators as Quantity.