Dominance (C++)

In the C++ programming language, dominance refers to a particular aspect of C++ name lookup in the presence of Inheritance.

[1] The Standard's description does not use the word "dominance", preferring to describe things in terms of declaration sets and hiding.

However, the Index contains an entry for "dominance, virtual base class" referring to section 10.2.

In the above example, Child::g contains a reference to the name f. However, the program as a whole contains four declarations of the name f. In order to figure out which f is meant, the compiler computes an overload set containing all the declarations which are not hidden at the point of the call.

The Standard calls out this surprising case in an informative note (§10.2 paragraph 10): When virtual base classes are used, a hidden declaration can be reached along a path through the subobject lattice that does not pass through the hiding declaration.