genetically modified slices - is it possible?

Adam D. Ruppe destructionator at gmail.com
Fri Nov 15 07:09:07 PST 2013


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.


More information about the Digitalmars-d-learn mailing list