The address is part of the object identifier. Separate objects of the same type having separate addresses are a general rule. This is how you know that there is more than one object.
In copy constructors, you can often find a test for self-assigning if (this != &other) . This will fail if different objects of the same type must have the same address.
Objects of different types cannot be compared, as it is in any case, therefore, not a problem. And we also have a structure and its first member and array and the first element, which have the same address but have different types.
An empty base class creates a problem here, but only if you have two base classes of the same type or the base class is of the same type as the first member of the derived class. Thus, there are special rules prohibiting the overlap of two identical objects in these cases.
The idea is that they should be two separate sub-objects and work in the test this != &that .
source share