Using zip to copy subarray into another

Jonathan M Davis jmdavisProg at gmx.com
Tue Aug 13 12:50:22 PDT 2013


On Tuesday, August 13, 2013 21:22:24 Craig Dillabaugh wrote:
> I have code that attempts to copy a slice of one array into
> another using zip. However, the array is not updated. I am
> guessing this is because modifying the returned tuple does not
> modify the actual arrays.
> 
> Is there any way to do this.

Why not just use std.algorithm.copy, or even just assigning one array to the 
other? e.g.

dest[2 .. 5] = src[1 .. 4];

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list