std.array.array broken?

Francesco Cattoglio francesco.cattoglio at gmail.com
Sat Feb 1 15:26:51 PST 2014


On Saturday, 1 February 2014 at 22:52:24 UTC, Andrej Mitrovic 
wrote:
> On Saturday, 1 February 2014 at 22:47:54 UTC, deed wrote:
>
> Docs also say:
>
> /**
> Note:
> Each $(D front) will not persist after $(D
> popFront) is called, so the caller must copy its contents (e.g. 
> by
> calling $(D to!string)) if retention is needed.
> */
>
> So you need to do a duplication for each element. Use this code:

Sorry, but I really don't understand this. At all.
"Returns a newly-allocated dynamic array consisting of a copy of 
the input range" to me sounds "Hey, I'm doing a copy". How is one 
supposed to understand that you need to go through hops for 
getting a good result?


More information about the Digitalmars-d-learn mailing list