Quantity.opBinary

Multiplication with another quantity.

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

Examples

auto w = 3 * metre;
auto h = 2 * metre;
assert(w * h == 12 * pow!2(metre));

Meta