[Issue 8084] std.stdio.ByLine is not true input range
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat May 12 19:37:03 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8084
--- Comment #6 from Steven Schveighoffer <schveiguy at yahoo.com> 2012-05-12 19:38:27 PDT ---
ByLine is a true input range, it has empty, popFront and front.
If it was not a true input range, foreach would not work on it.
I also think isInputRange would pass.
The major issue I see with ByLine is that its default type of front is char[].
It really should be const(char)[]. And in fact, I don't think char[] should be
possible.
Perhaps, this bug can be redone to address that.
(In reply to comment #4)
> OK. ByLine.front returns the slice of internal line buffer, so it specifies
> 'temporary' data. We should get dup in each iteration.
If you mean ByLine should dup for each iteration, that is extremely wasteful.
What if you only need the data during the loop and not afterward?
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list