Immutable woes

Simen kjaeraas simen.kjaras at gmail.com
Tue Sep 21 01:34:03 PDT 2010


Bob Cowdery <bob at bobcowdery.plus.com> wrote:

>  Ok, so assumeUnique when I read it a bit more will still share data but
> idup will copy data. Where are the docs for that. Something else not in
> the book - but then I guess there is a lot of detail not in the book.
> Thank goodness for forums.

The thing is, slices (as you did in xfer = buffer[0 .. $/2];) do not
copy data. I somehow misread your code as xfer[] = buffer[0 .. $/2];
which would copy data, if only xfer already had a length - sorry about  
that.

-- 
Simen


More information about the Digitalmars-d-learn mailing list