Thread overview | |||||
---|---|---|---|---|---|
|
March 12, 2012 [Issue 7692] New: std.conv.parse should do lookahead for "0x" in strings with radix 16 | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=7692 Summary: std.conv.parse should do lookahead for "0x" in strings with radix 16 Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: Phobos AssignedTo: nobody@puremagic.com ReportedBy: andrej.mitrovich@gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-03-11 19:50:29 PDT --- import std.conv; void main() { string s1 = "ff"; string s2 = "0xff"; assert(parse!uint(s1, 16) == 0xff); // ok assert(parse!uint(s2, 16) == 0xff); // fail, it's 0 } parse should pop the first two characters if the string starts with 0x. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 12, 2012 [Issue 7692] std.conv.parse should do lookahead for "0x" in strings with radix 16 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | http://d.puremagic.com/issues/show_bug.cgi?id=7692 --- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-03-11 19:53:45 PDT --- A simple thing to do would probably be to add this at the start of Target parse(Target, Source)(ref Source s, uint radix): if (radix == 16 && s.startsWith("0x")) s.popFrontN(2); -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 04, 2012 [Issue 7692] std.conv.parse should do lookahead for "0x" in strings with radix 16 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | http://d.puremagic.com/issues/show_bug.cgi?id=7692 Andrej Mitrovic <andrej.mitrovich@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --- Comment #2 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-10-04 12:43:24 PDT --- This would break code, notes: https://github.com/D-Programming-Language/phobos/pull/835 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation