genetically modified slices - is it possible?

Alexandr Druzhinin drug2004 at bk.ru
Fri Nov 15 07:12:23 PST 2013


15.11.2013 22:09, Adam D. Ruppe пишет:
> 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.
Thank you very much! I forget about .ptr.
What about ranges in general? They haven't .ptr.


More information about the Digitalmars-d-learn mailing list