Result.opBinary

Operators for Result-Result arithmetic.

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.

  1. Result opBinary(Result rhs)
    struct Result(V, E = V)
    pure nothrow
    opBinary
    (
    string op
    )
    if (
    op == "+" ||
    op == "-"
    )
  2. Result opBinary(Result rhs)

Meta