why this works
struct Base {
virtual void visit(const A &) { };
virtual void visit(const B &) { };
}
and this complains about ambiguity when calling visit method
template< typename T >
struct X {
virtual void visit(const T &) { };
};
struct Base: X< A >, X< B > { };
this also shows the same problem:
struct Y {
virtual void visit(const A &) { };
};
struct Z {
virtual void visit(const B &) { };
};
struct Base: Z, Y { };
somehow it looks like the multiple inheritance messes with the virtual function signatures...
with gcc version 4.8.0 20130411 (prerelease)