https://issues.dlang.org/show_bug.cgi?id=19980
--- Comment #1 from Vladimir Panteleev <[email protected]> --- There's a bunch of things going on here: 1. byLine pops its front eagerly, which means merely constructing a byLine will advance the file pointer. 2. files.map!(f => f.byLine) creates a range whose .front instantiates a new byLine instance, thus advancing the file pointer every time it is evaluated. However, it is not an error to evaluate a range's front multiple times, so there is no bug in tee / each / joiner. 3. Additionally, byLine (ByLineImpl) instances do not each have their own file pointer, which means that if you have more than one byLine instance attached to the same file, advancing one will also advance all others. (Not sure if we should fix this, as it is possible to imagine code relying on this.) --
