The OpenD Programming Language

PosInfInterval.intersection

Returns the intersection of two intervals

  1. Interval!TP intersection(Interval!TP interval)
  2. PosInfInterval intersection(PosInfInterval interval)
    struct PosInfInterval(TP)
    const pure nothrow
    intersection
    ()
  3. Interval!TP intersection(NegInfInterval!TP interval)

Parameters

interval PosInfInterval

The interval to intersect with this interval.

Examples

assert(PosInfInterval!Date(Date(1996, 1, 2)).intersection(
            PosInfInterval!Date(Date(1990, 7, 6))) ==
       PosInfInterval!Date(Date(1996, 1 , 2)));

assert(PosInfInterval!Date(Date(1996, 1, 2)).intersection(
            PosInfInterval!Date(Date(1999, 1, 12))) ==
       PosInfInterval!Date(Date(1999, 1 , 12)));

Meta