The OpenD Programming Language

Interval.contains

Whether the given time point is within this interval.

  1. bool contains(TP timePoint)
    struct Interval(TP)
    const pure
    bool
    contains
    (
    scope const TP timePoint
    )
  2. bool contains(Interval interval)
  3. bool contains(PosInfInterval!TP interval)
  4. bool contains(NegInfInterval!TP interval)

Parameters

timePoint TP

The time point to check for inclusion in this interval.

Throws

std.datetime.date.DateTimeException if this interval is empty.

Examples

assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(
            Date(1994, 12, 24)));

assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(
            Date(2000, 1, 5)));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(
            Date(2012, 3, 1)));

Meta