www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12320] New: std.stdio.LockingTextReader populates .front in .empty


           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 puremagic.com
        ReportedBy: peter.alexander.au gmail.com

--- Comment #0 from Peter Alexander <peter.alexander.au 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: -------
Mar 08 2014