Quantity.opBinaryRight

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

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

Examples

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

Meta