possible bug in std.conv.parse

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 26 18:08:33 PDT 2014


ah, i see:  if (radix == 10) return parse!Target(s); in Target 
parse(Target, Source)(ref Source s, uint radix)

it cheating a little and using 'general' decimal number parser, 
which accepts '+' and '-'. for other bases it uses another code 
though, where '+' and '-' threats as digits, which leads to error.

i think that it should either not accept sign in any radix, or 
accept always (given the resulting type is signed, of course). 
the later is much more logical if you'll ask me.


More information about the Digitalmars-d mailing list