The OpenD Programming Language

PosInfInterval.expand

Expands the interval backwards in time. Effectively, it does begin -= duration.

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

Parameters

duration D

The duration to expand the interval by.

Examples

auto interval1 = PosInfInterval!Date(Date(1996, 1, 2));
auto interval2 = PosInfInterval!Date(Date(1996, 1, 2));

interval1.expand(dur!"days"(2));
assert(interval1 == PosInfInterval!Date(Date(1995, 12, 31)));

interval2.expand(dur!"days"(-2));
assert(interval2 == PosInfInterval!Date(Date(1996, 1, 4)));

Meta