From C++ FAQ
"How can you reseat a reference to make it refer to a different object?"
But when I do this it compiles and executes fine.
int f = 5;
int y =4;
int& u = f;
u = y;
B& bRef = B();
bRef = B();
This code is inside my main() function.
Link of C++ FAQ https://isocpp.org/wiki/faq/references#reseating-refs