toChars Bug?

Steven Schveighoffer schveiguy at yahoo.com
Tue Dec 12 21:00:52 UTC 2017


On 12/12/17 7:49 AM, ketmar wrote:
> see documentation: 
> http://dpldocs.info/experimental-docs/std.conv.toChars.html
> 
> "...Can be uint or ulong. If radix is 10, can also be int or long."
> 
> 45 is int, not uint. so no radices except `10` will work.

So, the answer is:

toChars!2(45u);

BTW, I find this limitation is a bad code smell. IFTI needs some design 
thought on how to deal with literals.

-Steve


More information about the Digitalmars-d mailing list