In C++, is the address of a reference to a dereferenced pointer guaranteed to be the same as the address of the pointer?
Or, written in code, is the following assertion guaranteed to always hold true?
SomeType *ptr = someAddress;
SomeType &ref = *ptr;
assert(&ref == ptr);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…