You could make it work like this:

       auto slice3 = array[
                slice1.length + (slice1.ptr - array.ptr)
                ..
                (slice2.ptr - array.ptr)];


Since the slices all start into array somewhere, subtracting the pointers gives their start index.

Reply via email to