Implicit conversion better match than exact template?

Timon Gehr timon.gehr at gmx.ch
Sun Feb 9 04:31:34 PST 2014


On 02/09/2014 01:25 PM, Peter Alexander wrote:
> This writes "int" instead of "S". The implicit conversion is preferred
> over the exact match in the template. Is this correct?

No.

> I can't find  anything in the spec that explains how overload resolution
> works in the presence of templates.
> ...

TDPL states that if both non-templated function and templated function 
_match equally well_ the non-templated one will be preferred.




More information about the Digitalmars-d mailing list