Mixin template function

cal callumenator at gmail.com
Wed Feb 13 21:49:31 PST 2013


And a related question:

class A
{
     void foo(int i){}
     void foo(Tuple!(int) i){}
}

class B: A
{
     override void foo(int i){}
}


int main()
{

     auto b = new B;
     b.foo(tuple(5));
}

This fails to compile. Why can't B use A's tuple overload of 
foo()? If I do this:

class B: A
{
     override void foo(int i){}
     void foo(Tuple!(int) i){} // no override keyword is deprecated
}

The compiler warns about not using the override keyword, so it 
must be seeing the function?


More information about the Digitalmars-d-learn mailing list