On 9/3/13 10:59, Andrej Mitrovic wrote:
On 9/3/13, Lionello Lunesu <[email protected]> wrote:
struct Z {};
Z a, b;
assert(&a != &b);

Since the structs are declared empty, their 1-byte values don't
matter. So their addresses don't really matter either.


It has to do with the ol' 'identity vs equality'. In the example above, a and b are not identical ("do not refer to the same thing") and so their addresses should not be equal.

The address of two 'named things' is the same if-and-only-if the names refer to the same thing.

L.

Reply via email to