No, it can't. Unlike a pointer, once a reference is bound to an object, it cannot be made to refer to a different object. The alias cannot be separated from the referent. For example, the last line of the following example changes i to 6; it does not make the reference k refer to j. Throughout its short life, k will always refer to i. int main() { int i = 5; int j = 6; int& k = i; <-- 1 k = j; <-- 2 }
|