Region.opBinaryRight

Returns true iff point is in this region.

  1. bool opBinaryRight(in TaggedPoint point)
    struct Region(Number, Tag, string tagAlias = null, Tag emptyTag = Tag.init)
    bool
    opBinaryRight
    const pure nothrow
    (
    string op
    )
    if (
    op == "in"
    )
  2. alias includes = opBinaryRight!"in"

Examples

1 alias R = Region!(int, int);
2 alias TI = R.TaggedInterval;
3 alias TP = R.TaggedPoint;
4 
5 R emptyRegion;
6 auto region = R([TI(0, 0, 10), TI(1, 0, 10)]);
7 
8 assert(TP(0, 0) !in emptyRegion);
9 assert(TP(0, 5) !in emptyRegion);
10 assert(TP(0, 10) !in emptyRegion);
11 assert(TP(0, 20) !in emptyRegion);
12 assert(TP(0, 0) in region);
13 assert(TP(0, 5) in region);
14 assert(TP(0, 10) !in region);
15 assert(TP(0, 20) !in region);
16 assert(TP(1, 0) in region);
17 assert(TP(1, 5) in region);
18 assert(TP(1, 10) !in region);
19 assert(TP(1, 20) !in region);

Meta