On Thursday, 16 March 2017 at 16:59:40 UTC, Adam D. Ruppe wrote:
Yet the documentation says there's a toHexString that returns
a string.
Yes, indeed, it returns a string if it is passed a dynamic
array.
Ah, that's the distinction, should have noticed.
Remember though, like I warned on my doc fork, overload
resolution NEVER looks at the left hand side of the equation,
it is always done on arguments alone.
The stupid auto return stuff Phobos loves so much obscures it,
but md5Of returns a ubyte[16].
That calls the first overload, the one that returns char[num*2]
OK, but if I try to do this,
char[2] u;
string s = u;
the compiler will complain: Error: cannot implicitly convert
expression (u) of type char[2] to string. So why does it allow
the template instantiation of return type char[num*2] in place
of u above?