Fallback 'catch-all' template functions

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 3 04:32:48 PDT 2016


On 9/3/2016 4:22 AM, Jacob Carlborg wrote:
> On 2016-09-03 11:56, Walter Bright wrote:
>
>> Specializations are preferred over non-specializations, and T:T is the
>> identity specialization.
>
> What if the compiler can prefer template constraint in the same way? Then
> perhaps this workaround could be avoided.

It's extremely risky to invent new template lookup rules for existing code. Who 
knows whose carefully constructed template ox will get gored by it.

The suggested technique is simple, works on all the existing D compilers since 
constraints, and doesn't break anything.

I suggest we move on.



More information about the Digitalmars-d mailing list