Yes, provided of course that someAddress
is not a null pointer, or otherwise not allowed to be dereferenced. In that case, behavior is undefined, although your implementation might well behave as though they are equal, especially with low optimization levels.
If you want to be precise, then &ref
isn't really the "address of a reference", it's the "address of the referand of a reference". Since ref
was bound to *ptr
, that means the referand of ref
and the referand (or pointee if you prefer) of ptr
are the same object, and hence the two addresses &ref
and ptr
are equal.
And as Bo points out, what you're comparing &ref
with is the "value of the pointer", or the "address stored in the pointer", rather than "the address of the pointer".