The OpenD Programming Language

NegInfInterval.expand

Expands the interval forwards in time. Effectively, it does end += duration.

  1. void expand(D duration)
    struct NegInfInterval(TP)
    pure nothrow
    void
    expand
    (
    D
    )
    if (
    __traits(compiles, end + duration)
    )
  2. void expand(T years, T months, AllowDayOverflow allowOverflow)

Parameters

duration D

The duration to expand the interval by.

Examples

auto interval1 = NegInfInterval!Date(Date(2012, 3, 1));
auto interval2 = NegInfInterval!Date(Date(2012, 3, 1));

interval1.expand(dur!"days"(2));
assert(interval1 == NegInfInterval!Date(Date(2012, 3, 3)));

interval2.expand(dur!"days"(-2));
assert(interval2 == NegInfInterval!Date(Date(2012, 2, 28)));

Meta