Bug 12320 – std.stdio.LockingTextReader populates .front in .empty
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-08T11:35:00Z
Last change time
2015-02-18T03:39:51Z
Assigned to
nobody
Creator
peter.alexander.au
Comments
Comment #0 by peter.alexander.au — 2014-03-08T11:35:55Z
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.