Duration.opBinary

Adds, subtracts or calculates the modulo of two durations.

The legal types of arithmetic for Duration using this operator are

Duration+Duration-->Duration
Duration-Duration-->Duration
Duration%Duration-->Duration
Duration+TickDuration-->Duration
Duration-TickDuration-->Duration
  1. Duration opBinary(D rhs)
    struct Duration
    @safe pure
    opBinary
    const nothrow @nogc
    (
    string op
    D
    )
    (
    D rhs
    )
    if (
    (
    (
    op == "+" ||
    op == "-"
    ||
    op == "%"
    )
    &&
    is(_Unqual!D == Duration)
    )
    ||
    (
    (
    op == "+" ||
    op == "-"
    )
    &&
    is(_Unqual!D == TickDuration)
    )
    )
  2. Duration opBinary(long value)
  3. long opBinary(Duration rhs)

Parameters

rhs
Type: D

The duration to add to or subtract from this Duration.

Suggestion Box / Bug Report