The OpenD Programming Language

Interval.span

Returns an interval that covers from the earliest time point of two intervals up to (but not including) the latest time point of two intervals.

  1. Interval span(Interval interval)
  2. PosInfInterval!TP span(PosInfInterval!TP interval)
  3. NegInfInterval!TP span(NegInfInterval!TP interval)
    struct Interval(TP)
    const pure
    span
    (
    scope const NegInfInterval!TP interval
    )

Parameters

interval NegInfInterval!TP

The interval to create a span together with this interval.

Throws

std.datetime.date.DateTimeException if this interval is empty.

Examples

assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(
            NegInfInterval!Date(Date(1602, 5, 21))) ==
       NegInfInterval!Date(Date(2012, 3 , 1)));

assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(
            NegInfInterval!Date(Date(2013, 1, 12))) ==
       NegInfInterval!Date(Date(2013, 1 , 12)));

Meta