|
|||||||||||||||||
|
Section 8:
|
[8.5] How can you reseat a reference to make it refer to a different object?
No way. You can't separate the reference from the referent. Unlike a pointer, once a reference is bound to an object, it can not be "reseated" to another object. The reference itself isn't an object (it has no identity; taking the address of a reference gives you the address of the referent; remember: the reference is its referent). In that sense, a reference is similar to a const pointer such as int* const p (as opposed to a pointer to const such as int const* p). But please don't confuse references with pointers; they're very different from the programmer's standpoint. |
||||||||||||||||