struct A {
void f(int x) {}
};
struct B {
template void f(T x) {}
};
struct C : public A, public B {};
struct D {
void f(int x){}
te
I believe the compiler prefers A::f
(non-template function) over B::f
for no reason.
This seems to be a compiler implementation bug more than a implementation dependent detail.
If you add following line, then compilation goes fine and the correct function B::f<>
is selected:
struct C : public A, public B {
using A::f; // optional
using B::f;
};
[Funny part is that until the ::f
are not brought into the scope of C
, they are treated as alien functions.]