On Thu, Aug 31, 2017 at 06:26:33PM +0000, Sergei Degtiarev via 
Digitalmars-d-learn wrote:
[...]
>       File[] files;
>       ....
>       foreach(ln; joiner(files.map!(a => a.byLine)))
>               writeln(ln);

You probably want to use byLineCopy instead.

The problem here is that .byLine returns a transient range (i.e., the
value returned by .front changes after .popFront is called), which can
cause unexpected behaviour when used with certain algorithms.


T

-- 
I don't trust computers, I've spent too long programming to think that they can 
get anything right. -- James Miller

Reply via email to