How can I induce implicit type convesion with alias this on calling template function?

Sobaya sobaya007 at gmail.com
Mon Oct 15 14:35:01 UTC 2018


On Monday, 15 October 2018 at 06:16:34 UTC, Alex wrote:
> On Monday, 15 October 2018 at 04:51:39 UTC, Sobaya wrote:
>> [...]
>
> Removing constraint, but retaining specialization should be 
> enough, no?
> Then, func is still a template, requiring the argument to be 
> convertible to an int. When S is passed, then, it is checked, 
> if it convertible, and because of the alias it is.
> Still, passed value has the type of S. however, func can handle 
> value directly, as it were an int.

Thank you!


More information about the Digitalmars-d-learn mailing list