QVariant

A dimensionnaly variant quantity.

Constructors

this
this(T scalar, Dimensions dim)
Undocumented in source.
this
this(Q qty)

Creates a new quantity from another one with the same dimensions

this
this(T scalar)

Creates a new dimensionless quantity from a number

Alias This

get

Members

Aliases

valueType
alias valueType = N
Undocumented in source.

Functions

baseUnit
QVariant baseUnit()

Returns the base unit of this quantity.

dimensions
Dimensions dimensions()

Returns the dimensions of the quantity

get
N get()

Implicitly convert a dimensionless value to the value type.

isConsistentWith
bool isConsistentWith(Q qty)

Tests wheter this quantity has the same dimensions as another one.

isDimensionless
bool isDimensionless()

Test whether this quantity is dimensionless

opAssign
QVariant opAssign(Q qty)
QVariant opAssign(T scalar)
opBinary
QVariant!N opBinary(Q qty)
QVariant!N opBinary(T scalar)
QVariant!N opBinary(T power)
QVariant!N opBinary(Rational power)
opBinaryRight
QVariant!N opBinaryRight(Q qty)
QVariant!N opBinaryRight(T scalar)

Operator overloading

opCast
T opCast()

Cast a dimensionless quantity to a numeric type.

opCmp
int opCmp(Q qty)
int opCmp(T scalar)
opEquals
bool opEquals(Q qty)
bool opEquals(T scalar)
opOpAssign
void opOpAssign(Q qty)
void opOpAssign(T scalar)
opUnary
QVariant!N opUnary()

Operator overloading

rawValue
N rawValue()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
void toString(void delegate(const(char)[]) sink, FormatSpec!char fmt)
Undocumented in source. Be warned that the author may not have intended to support it.
value
N value(Q target)

Gets the value of this quantity when expressed in the given target unit.

Parameters

N

the numeric type of the quantity.

See Also

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

Meta