Interval.merge

Returns the union of two intervals

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

Parameters

interval PosInfInterval!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(
            PosInfInterval!Date(Date(1990, 7, 6))) ==
       PosInfInterval!Date(Date(1990, 7 , 6)));

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

Meta