Summary: array(file.byLine()) is a problem
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from Andrej Mitrovic <> 2011-08-14 
12:12:05 PDT ---
I can use readText, but if I want to use the byLine range with a call to
array() to save the lines of a text I end up getting garbage (I know why):

auto file = File("foo.txt", "r");
auto lineBuff = array(file.byLine());

I don't know if it can be fixed, I mean array() is not to blame (it only
exhausts a range), and byLine reuses a char[] buffer to stay efficient. But it
looks like something that could be thought about.

As a workaround I can do:

lineBuff = readText(r"file.txt").splitLines;

So it's not a big issue, but I ran into it and hence this report.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to