Quantity.opBinaryRight

Multiplication with a unit instance.

Returns a quantity with the same value, but the new unit.

  1. auto opBinaryRight(T lhs)
  2. auto opBinaryRight(Lhs lhs)
    struct Quantity(Unit, ValueType = double)
    static if(!is(Unit.LinearBaseUnit BaseUnit))
    opBinaryRight
    (
    string op : "*"
    Lhs
    )
    (
    Lhs lhs
    )
    if (
    isUnit!Lhs
    )
    if (
    isUnit!Unit
    )
  3. auto opBinaryRight(Lhs rhs)
  4. auto opBinaryRight(Quantity!(BaseUnit, RhsV) lhs)
  5. auto opBinary(Rhs rhs)

Examples

auto l = 6 * metre;
assert(l * metre == 6 * pow!2(metre));

Meta