Interval.merge

Returns the union of two intervals

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

Parameters

interval NegInfInterval!TP

The interval to merge with this interval.

Throws

std.datetime.date.DateTimeException if the two intervals do not intersect and are not adjacent or if this interval is empty.

Examples

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

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

Meta