[Issue 12320] New: std.stdio.LockingTextReader populates .front in .empty

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 8 11:35:56 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12320

           Summary: std.stdio.LockingTextReader populates .front in .empty
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: peter.alexander.au at gmail.com


--- Comment #0 from Peter Alexander <peter.alexander.au at gmail.com> 2014-03-08 11:35:55 PST ---
In std.stdio.LockingTextReader, if you call .front after calling popFront, the
value will be dchar.init. You have to call .empty before .front to get a
meaningful value.

This is fine for the vast majority of use cases, but if you happen to know a
file has so many bytes then you might call .front without calling .empty, and
that should work.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list