TITLE: Name domination in derived classes PROBLEM: Arthur Sombrito (arthur@solomon.technet.sg) I'd like to ask some clarification regarding ARM rules on name domination in derived classes. Sec. 10.1.1 states that "A name B::f dominates a name A::f if its class B has A as a base." An examples illustrates the point with a virtual base class. Does this apply to non-virtual base classes as well? For example: class A { public: int f(); }; class B : public A { public: int f(); }; class C : public B, public A { void g() { f(); // Does B::f dominate A::f? } }; RESPONSE: steve@taumet.com (Steve Clamage) Whether the functions are virtual is irrelevant to dominance and to name hiding. The three concepts (virtual, dominance, hiding) are independent. Bjarne Stroustrup already answered the question about dominance. Virtualness affects only which version of a function gets called via a pointer or reference. It does not affect dominance or name hiding. RESPONSE: frank@Cookie.secapl.com (Frank Adams) This is correct if by "virtual" you mean only "virtual function". Virtual base classes are critically important to dominance. In particular, I believe that if the base classes in the example above are all made virtual, the answer changes; B::f now *does* dominate A::f. As defined, the hierarchy looks like: A | B A \ / C The two A's are distinct here, and the second A::f is not dominated by B::f. (This is what Bjarne said.) If you make the inheritance virtual, it looks like: A /| B | \| C and now the (only) A::f *is* dominated by B::f.