Thread overview
Re: conv.to for radixes
Nov 23, 2011
Andrej Mitrovic
Nov 23, 2011
Jonathan M Davis
Nov 23, 2011
Andrej Mitrovic
November 23, 2011
Let me demonstrate why this is a problem:

string get() { return "ff"; }
void main()
{
    writeln(parse!int(get(), 16));
}

Error: get() is not an lvalue
November 23, 2011
On Wednesday, November 23, 2011 04:39:37 Andrej Mitrovic wrote:
> Is there any special reason why conv.to doesn't work with radixes, and we have to use parse instead?
> 
> import std.conv;
> import std.stdio;
> 
> void main()
> {
>     writeln(parse!int("ff", 16));  // ok
>     writeln(to!int("ff", 16));     // NG
> }

I'm not aware of any technical reason why it isn't feasible. Open an enhancement request. You can ping Kenji Hara about it if you'd like too, since he's likely the one to do it, since he's the one who's been actively working on std.conv.

- Jonathan M Davis
November 23, 2011
Oki, http://d.puremagic.com/issues/show_bug.cgi?id=6992 .