View source code
Display the source code in core/time.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

core.time.Duration.opBinary - multiple declarations

Function Duration.opBinary

Adds, subtracts or calculates the modulo of two durations.

Duration opBinary(string op) (
  const Duration rhs
) const nothrow @nogc
if (op == "+" || op == "-" || op == "%");

The legal types of arithmetic for Duration using this operator are

Duration + Duration --> Duration
Duration - Duration --> Duration
Duration % Duration --> Duration

Parameters

NameDescription
rhs The duration to add to or subtract from this Duration.

Function Duration.opBinary

Multiplies or divides the duration by an integer value.

Duration opBinary(string op) (
  long value
) const nothrow @nogc
if (op == "*" || op == "/");

The legal types of arithmetic for Duration using this operator overload are

Duration * long --> Duration
Duration / long --> Duration

Parameters

NameDescription
value The value to multiply this Duration by.

Function Duration.opBinary

Divides two durations.

long opBinary(string op) (
  Duration rhs
) const nothrow @nogc
if (op == "/");

The legal types of arithmetic for Duration using this operator are

Duration / Duration --> long

Parameters

NameDescription
rhs The duration to divide this Duration by.

Authors

Jonathan M Davis and Kato Shoichi

License

Boost License 1.0.