Quantity.opOpAssign

Multplication/division by a plain value (i.e. a dimensionless quantity not represented by a Quantity instance).

  1. Quantity opOpAssign(Quantity!(Unit, RhsV) rhs)
  2. Quantity opOpAssign(T rhs)
    struct Quantity(Unit, ValueType = double)
    ref
    static if(!is(Unit.LinearBaseUnit BaseUnit))
    opOpAssign
    (
    string op
    T
    )
    (
    T rhs
    )
    if (
    (
    op == "*" ||
    op == "/"
    )
    &&
    !isUnit!T
    &&
    !isQuantity!T
    &&
    __traits(compiles, ())
    )
    if (
    isUnit!Unit
    )
  3. Quantity opOpAssign(Quantity!(BaseUnit, RhsV) rhs)
  4. auto opBinary(T rhs)
  5. auto opBinaryRight(T lhs)

Examples

auto l = 6 * metre;
assert(l * 2 == 12 * metre);
l /= 2;
assert(l == 3 * metre);

Meta