The OpenD Programming Language

NegInfInterval.merge

Returns the union of two intervals

  1. NegInfInterval merge(Interval!TP interval)
  2. NegInfInterval merge(NegInfInterval interval)
    struct NegInfInterval(TP)
    const pure nothrow
    merge
    ()

Parameters

interval NegInfInterval

The interval to merge with this interval.

Note: There is no overload for merge which takes a PosInfInterval, because an interval going from negative infinity to positive infinity is not possible.

Examples

assert(NegInfInterval!Date(Date(2012, 3, 1)).merge(
            NegInfInterval!Date(Date(1999, 7, 6))) ==
       NegInfInterval!Date(Date(2012, 3 , 1)));

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

Meta