Function templates do implicit conversions for their arguments

TommiT tommitissari at hotmail.com
Thu Jul 4 13:24:25 PDT 2013


On Thursday, 4 July 2013 at 20:11:56 UTC, TommiT wrote:
> 
> C++ never accepts anything but an exact match between the 
> parameter types of the instantiated template function and the 
> types of the arguments passed in to the function at the call 
> site which caused the instantiation.

Although, that's not exactly true. C++ accepts an inexact match 
when the instantiated parameter is either a reference or a 
pointer to a public base class of the passed argument type. I.e. 
there is an is-a relationship.


More information about the Digitalmars-d mailing list