Quantity.opAssign

Two quantites of the same unit are implicitely convertible on assignment if the underlying value types are.

  1. this(Quantity!(Unit, OtherV) other)
  2. Quantity opAssign(Quantity!(Unit, OtherV) other)
    struct Quantity(Unit, ValueType = double)
    ref
    opAssign
    (
    OtherV
    )
    (
    Quantity!(Unit, OtherV) other
    )
    if (
    isAssignable!(ValueType, OtherV)
    )
    if (
    isUnit!Unit
    )

Examples

Quantity!(metre, float) a = 2 * metre;

Meta