Bug 3223 – bool value conversions from "false" and "true" are missing
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-08-01T23:04:00Z
Last change time
2015-06-09T01:26:25Z
Assigned to
andrei
Creator
acehreli
Comments
Comment #0 by acehreli — 2009-08-01T23:04:13Z
false and true are outputted as "false" and "true". It is natural to have the opposite conversions as well. The following program outputs
Segmentation fault
when "false" is sent to its standard input:
import std.cstream;
void main()
{
bool b;
din.readf(&b);
}
There doesn't seem to be any conversion from "false" and "true" to bool anywhere in Phobos.
Comment #1 by bugzilla — 2010-06-15T01:50:55Z
FYI, to() and parse() can now convert from string to bool:
http://www.dsource.org/projects/phobos/changeset/1646
Since std.stream is (about to be?) deprecated, it's probably not worth fixing the issue with std.stream.Stream.readf().