Trying to understand how reassignment of references is blocked in C++. I understand that as in Reassigning C++ reference variables the reference itself cant be reassigned but the value of the refree is being changed. But I want to understand how this works for instance objects
For below code
class A{};
A aobj;
A& aref = aobj;
A bobj;
aref = bobj;
Want to understand if above is legal and whats happening here.
If its legal then I am not able to understand how does it work. Are we just changing the value the variable 'aobj' holds? Then isent that same as 'aref' referring now to object 'bobj'
If its illegal is it considered as an attempt to reassign a reference?