Have anybody implemented intersections for array slices that overlap in memory? Algorithm returns [] upon no overlap.
I want this when pretty-printing (using overlap indentation) arrays slices that overlap in memory.
if you are sure they are arrays then just take the difference of the ptr fields:
size_t startoffset = b.ptr-a.ptr
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With