Function Result.opOpAssign

Operators for Result-Result arithmetic.

Result opOpAssign(string op) (
  Result rhs
) pure nothrow
if (op == "+" || op == "-");

Note that these operations also perform error calculations, and are thus a bit slower than working directly with the value itself. It is assumed that the error is much smaller than the value, so terms of order O(δx δy) or O(δx²) are ignored.

Also note that multiplication and division are only possible when the value type V and the error type E are the same (as is the default).

Through the magic of "alias this", Result!(V, E) is implicitly castable to the type V, and thus supports the same operations as V in addition to these.