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, D)
(
D rhs
) const nothrow @nogc
if ((op == "+" || op == "-" || op == "%") && is(_Unqual!D == Duration) || (op == "+" || op == "-") && is(_Unqual!D == TickDuration));
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 |
Parameters
Name | Description |
---|---|
rhs | The duration to add to or subtract from this Duration . |
Function Duration.opBinary
Multiplies or divides the duration by an integer value.
The legal types of arithmetic for Duration
using this operator
overload are
Duration | * | long | --> | Duration |
Duration | / | long | --> | Duration |
Parameters
Name | Description |
---|---|
value | The value to multiply this Duration by. |
Function Duration.opBinary
Divides two durations.
The legal types of arithmetic for Duration
using this operator are
Duration | / | Duration | --> | long |
Parameters
Name | Description |
---|---|
rhs | The duration to divide this Duration by. |
Authors
Jonathan M Davis and Kato Shoichi
License
Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.