Quantity.opBinaryRight

Addition/substraction of a quantity with the linear base unit.

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

Examples

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

Meta