C++ Resolving the diamond problem
问题 Couldn't the diamond problem be resolved just by using the first inherited declaration found? I mean, public class A { public virtual int getInt(); }; public class B : public A { public int getInt() {return 6;} }; public class C : public A { public int getInt() {return 7;} }; public class D: public B, public C {}; for class D , since B is listed first, couldn't we just by default (when it's ambiguous) use B::getInt() if D::getInt() is called? Kind of how the PATH environment variable works in