Thread overview | |||||
---|---|---|---|---|---|
|
November 23, 2011 Re: conv.to for radixes | ||||
---|---|---|---|---|
| ||||
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 Re: conv.to for radixes | ||||
---|---|---|---|---|
| ||||
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 Re: conv.to for radixes | ||||
---|---|---|---|---|
| ||||
Oki, http://d.puremagic.com/issues/show_bug.cgi?id=6992 . |
Copyright © 1999-2021 by the D Language Foundation