On 12/22/15 10:40 AM, Adam D. Ruppe wrote:

In specialization, it will implicitly convert, it will just select the
best match available.

Make #1:

     void func(T : ubyte)(T v) { writeln(1); }

It will then use that for for the second line because it is a *better*
match than :int, but :int still is a match so it works as a fallback.


Type specialization has some weird properties in this regard. Sometimes it needs to be exact or explicit, sometimes it doesn't.

http://forum.dlang.org/post/rvflnpxwzetpcphwx...@forum.dlang.org

-Steve

Reply via email to