cloning array
Gavin Ray
gavinray at site.com
Wed Jun 2 16:50:16 UTC 2021
On Wednesday, 2 June 2021 at 16:07:35 UTC, Basile.B wrote:
> works a expected. The reason why is that your array elements
> are fat pointers, so when you dup a, you dup some fats pointer,
> so you got the same elements as "a" but accessible from another
> chunck of memory.
Would it be worth modifying the docs for `.dup()` so that this
behavior is clear?
I would have been confused by this as well. It's probably a
no-brainer if you understand general memory principles but not
everyone does.
More information about the Digitalmars-d-learn
mailing list