Template overloads involving `string` and `char[constant]` return value

Johan Engelen via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Sep 21 05:29:54 PDT 2016


On Wednesday, 21 September 2016 at 12:20:14 UTC, Adam D. Ruppe 
wrote:
> 
> It is neither, the compiler chose the right overload (remember, 
> overloads are chosen based on the arguments alone, the type you 
> specify for the variable holding the return value isn't a 
> consideration there) and the implementation of each overload is 
> correct.

Wouldn't something like this be possible?

`T toHexString(string toHexString(Order order = Order.increasing, 
LetterCase letterCase = LetterCase.upper, T)(.........) if (T == 
string)`


More information about the Digitalmars-d-learn mailing list