Duration.opOpAssign

Adds, subtracts or calculates the modulo of two durations as well as assigning the result to this Duration.

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 opOpAssign(const scope D rhs)
    struct Duration
    @safe pure ref
    opOpAssign
    nothrow @nogc
    (
    string op
    D
    )
    (
    const scope D rhs
    )
    if (
    (
    (
    op == "+" ||
    op == "-"
    ||
    op == "%"
    )
    &&
    is(_Unqual!D == Duration)
    )
    ||
    (
    (
    op == "+" ||
    op == "-"
    )
    &&
    is(_Unqual!D == TickDuration)
    )
    )
  2. Duration opOpAssign(long value)

Parameters

rhs
Type: D

The duration to add to or subtract from this Duration.

Suggestion Box / Bug Report