std.range.interfaces : InputRange moveFront

Johan Engelen j at j.nl
Sun Dec 3 05:45:54 UTC 2017


On Friday, 1 December 2017 at 18:55:53 UTC, Steven Schveighoffer 
wrote:
>
> Once you popFront a byLine range, the element that was at front 
> is now possibly invalid (the buffer may be reused). So in order 
> to return the line from popFront, you have to store it 
> somewhere. This means allocating another buffer to hold the 
> line you just returned. So the costs of doing this aren't just 
> that you might do work and just throw it away, it's that you 
> have this extra caching problem you didn't have before.

Cool, thanks.
Can we add points like this to the documentation?
(if not, user frustration and forum threads will keep coming 
about these things... ;-)

-Johan



More information about the Digitalmars-d-learn mailing list