An idiom for disabling implicit conversions

bearophile bearophileHUGS at lycos.com
Fri Mar 19 03:08:10 PDT 2010


Don:
> Not without loss of capability.

So this means "all separately instantiated add() functions with T that the compiler can automatically cast to uint":
void add(T:ulong)(T x) {

So it's something very different from the template constraint, that just accepts/refuses to see the template according to the if clause.

I have programmed D1 for years thinking add(T:ulong) means something different, a single instantiation with ulong. I was wrong.

Thank you, as usual,
bearophile



More information about the Digitalmars-d mailing list