Given the class C defined above, an object of class C will have two sub-objects of class L as shown below. In such lattices, explicit qualification can be used to specify which subobject is meant. Given the class C defined above, an object of class C will have one subobject of class V , as shown below. A class can have both virtual and nonvirtual base classes of a given type. Z 's B and the virtual B shared by X and Y , as shown below.
Name lookup can result in an ambigu ity , in which case the program is ill-formed.
The following steps define the result of name lookup in a class scope. First, we consider every declaration for the name in the class and in each of its base class sub-objects. We eliminate from consideration any declarations that are so hidden. Otherwise that set is the result of the lookup. Ambiguities can often be resolved by qualifying a name with its class name.