mixin not overloading other mixins, Bug or feature?

BCS none at anon.com
Tue Dec 22 18:28:34 PST 2009


Hello Travis,

> float func1(float[2] v) { return v[0]; }
> float func1(float[3] v) { return v[0]; }
> template Test (size_t S) {
> float func2(float[S] v) { return v[0]; }
> }
> mixin Test!(2);
> mixin Test!(3);
> void main() {
> float[2] a2;
> func1(a2);
> func2(a2);
> }
> Here the call to func1 is fine, but the call to func2 results in a
> conflict.
> 
> Test!(2).func2 conflicts with unit.Test!(3).func2
> 
> This was tested with ldc (dmd 1.051).
> 
> Is this a bug or a "feature"?
> 

IIRC it's a fature. I forget where, but I recall reading that they don't 
overload.





More information about the Digitalmars-d mailing list