Quantity.opBinary

Substracts a quantity of the same unit, yielding a quantity of the non- affine base unit.

  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)
  6. auto opBinary(Quantity!(RhsU, RhsV) rhs)
  7. auto opBinary(Quantity!(Unit, RhsV) rhs)
    struct Quantity(Unit, ValueType = double)
    static if(!(!is(Unit.LinearBaseUnit BaseUnit)))
    opBinary
    (
    string op : "-"
    RhsV
    )
    (
    Quantity!(Unit, RhsV) rhs
    )
    if (
    is(typeof(ValueType.init - RhsV.init))
    )
    if (
    isUnit!Unit
    )
  8. auto opBinary(Quantity!(BaseUnit, RhsV) rhs)

Examples

auto a = 3 * celsius;
auto b = 2 * celsius;
assert(a - b == 1 * kelvin);

Meta