Returns true iff the tagged intervals intersect.
Returns true iff the tagged intervals do not intersect and this > other.
Returns true iff the tagged intervals do not intersect and this < other.
Returns the intersection of both intervals; empty if tags differ.
Returns the difference of both intervals.
Returns true iff this is a subset of other, ie. fully included _in_.
Returns the intersection of both intervals; empty if tags differ.
Returns true iff the interval is empty. An interval is empty iff begin == end.
Returns the size of this interval.
Returns the convex hull of the intervals.
1 static enum emptyTag = 42; 2 alias R = Region!(int, int, "bucketId", emptyTag); 3 alias TI = R.TaggedInterval; 4 5 TI emptyInterval; 6 7 // Default constructor produces empty interval. 8 assert((emptyInterval).empty); 9 assert(emptyInterval.tag == emptyTag); 10 11 auto ti1 = TI(1, 0, 10); 12 13 // The tag can be aliased: 14 assert(ti1.tag == ti1.bucketId); 15 16 auto ti2 = TI(1, 5, 15); 17 18 // Tagged intervals with the same tag behave like regular intervals: 19 assert((ti1 & ti2) == TI(1, 5, 10)); 20 21 auto ti3 = TI(2, 0, 10); 22 23 // Tagged intervals with different tags are distinct: 24 assert((ti1 & ti3).empty);
This is a right-open interval [begin, end) tagged with tag. If tagAlias is given then the tag may be access as a property of that name.