Re: toChars Bug?

2017-12-12 Thread Steven Schveighoffer via Digitalmars-d
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 thi

Re: toChars Bug?

2017-12-12 Thread John Colvin via Digitalmars-d
On Tuesday, 12 December 2017 at 15:19:48 UTC, ketmar wrote: p.s.: but no, i am wrong. foo(-42); this is perfectly valid for `foo (uint n)`, as D converts negative ints to uints without any warnings. so no, overloads won't fit. hmm yes, it seems it is not possible.

Re: toChars Bug?

2017-12-12 Thread ketmar via Digitalmars-d
John Colvin wrote: On Tuesday, 12 December 2017 at 12:49:32 UTC, 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. I thin

Re: toChars Bug?

2017-12-12 Thread ketmar via Digitalmars-d
p.s.: but no, i am wrong. foo(-42); this is perfectly valid for `foo (uint n)`, as D converts negative ints to uints without any warnings. so no, overloads won't fit.

Re: toChars Bug?

2017-12-12 Thread John Colvin via Digitalmars-d
On Tuesday, 12 December 2017 at 12:49:32 UTC, 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. I think it would be possi

Re: toChars Bug?

2017-12-12 Thread ketmar via Digitalmars-d
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.

toChars Bug?

2017-12-12 Thread Bottled Gin via Digitalmars-d
Greetings This small code snippet works: // import std.conv; import std.stdio; void main() { writeln(toChars!10(45)); } But if I change toChars!10 with toChars!2, I get: /tmp/test.d(6): Error: template std.conv.toChars cannot deduce function from argument types !(2)(int), candidates are: