Region.opBinaryRight

Computes the union of all tagged intervals.

  1. Region opBinaryRight(TaggedInterval other)
    struct Region(Number, Tag, string tagAlias = null, Tag emptyTag = Tag.init)
    const
    opBinaryRight
    (
    string op
    )
    if (
    op == "|"
    )
  2. Region opBinaryRight(TaggedInterval other)
  3. bool opBinaryRight(TaggedPoint point)

Examples

alias R = Region!(int, int);
alias TI = R.TaggedInterval;

assert((R(0, 10, 20) | R(0, 0, 5)) == R([TI(0, 10, 20), TI(0, 0, 5)]));
assert((R(0, 10, 20) | R(0, 5, 15)) == R(0, 5, 20));
assert((R(0, 10, 20) | R(0, 12, 18)) == R(0, 10, 20));
assert((R(0, 10, 20) | R(0, 10, 20)) == R(0, 10, 20));
assert((R(0, 10, 20) | R(0, 15, 25)) == R(0, 10, 25));
assert((R(0, 10, 20) | R(0, 25, 30)) == R([TI(0, 10, 20), TI(0, 25, 30)]));
assert((R(0, 10, 20) | R(1, 25, 30)) == R([TI(0, 10, 20), TI(1, 25, 30)]));

Meta