I understand that when I create the dreaded diamond
struct Base { void foo() { } };
struct A: Base { };
struct B: Base { };
struct AB: A, B { };
The memory representation is
Base Base
| |
A B
\ /
AB
so calling AB ab; ab.foo();
causes ambiguosity problem. But when I hide the foo from one branch
struct Base { void foo() { } };
struct A: Base { private: using Base::foo; };
struct B: Base { };
struct AB: A, B { };
there should be just one accessible foo in ab
, yet the ambiguosity is still there. What am I missing?