PosInfInterval.intersection

Returns the intersection of two intervals

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

Parameters

interval NegInfInterval!TP

The interval to intersect with this interval.

Throws

std.datetime.date.DateTimeException if the two intervals do not intersect.

Examples

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

assert(PosInfInterval!Date(Date(1996, 1, 2)).intersection(
            NegInfInterval!Date(Date(2013, 1, 12))) ==
       Interval!Date(Date(1996, 1 , 2), Date(2013, 1, 12)));

Meta