overlaps

Detect overlap between this interval and other given interval in a * half-open coordinate system [start, end) * * return true in any of the following four situations: * int1 ===== ======= * int2 ======= ======= * * int1 ======= ======= * int2 === ======= * * return false in any other scenario: * int1 ===== | ===== * int2 ===== | ===== * * NOTE that in half-open coordinates [start, end) * i1.end == i2.start => Adjacent, but NO overlap * * Note: This code is copied from the dub package intervaltree. * Author: James S. Blachly, MD <james.blachly@gmail.com> * Copyright: Copyright (c) 2019 James Blachly * License: MIT

@nogc pure @safe nothrow
bool
overlaps
(
IntervalType1
IntervalType2
)
(
IntervalType1 int1
,
IntervalType2 int2
)
if (
__traits(hasMember, IntervalType1, "start") &&
__traits(hasMember, IntervalType1, "end")
&&
__traits(hasMember, IntervalType2, "start")
&&
__traits(hasMember, IntervalType2, "end")
)

Meta