Bug 6992 – Implement radix conversion for std.conv.to
Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-11-22T20:21:00Z
Last change time
2011-12-13T18:25:17Z
Assigned to
nobody
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2011-11-22T20:21:40Z
import std.conv;
import std.stdio;
void main()
{
writeln(parse!int("ff", 16)); // ok
writeln(to!int("ff", 16)); // NG
}
parse works ok with literals, but not with strings:
string get() { return "ff"; }
void main()
{
writeln(parse!int(get(), 16));
}
Comment #1 by yebblies — 2011-12-13T18:25:17Z
parse only works with string literals due to bug 4539.
Also, you already filed this bug in July.
*** This issue has been marked as a duplicate of issue 6255 ***