P
peter koch
Can you tell me where in the standard, that requirement is stated? Ipeter koch wrote:
(e-mail address removed) wrote:
[...]
I certainly hope not. That wouldn't be conform. (I presume, of
course, that the compiler will only do so if the objects are
PODs as well. Otherwise, the code won't be identical.)
I believe you are wrong.
I'm sure I'm not. The issue has been discussed before.
[snip]But you compare two different types. I do know that for two
objects of the same type, if their adress compares equal, the
adresses must refer to the same object.
This is true for objects of different types as well, as long as
they are complete objects (e.g. not base classes or members of a
class or union). Except, of course, objects with different
complete types must be different objects.
only found [expr.eq] which in the first paragraph states that:
"Pointers to objects or functions of the same type (after pointer
conversions) can be compared for equality. Two pointers of the same
type compare equal if and only if they are both null, both point to
the same function, or both represent the same address"
The way I read this paragraph, I do not see any support for your
statement, but you might have another paragraph/interpretation?
[snip]
/Peter