I am learning C++ and I came across move semantics. However I am unable to understand as to what is happening when we are try to add a new element to a vector that is full. How is move different from copying. We would any how have to allocate new memory for e.g. twice the size of the previous vector. What will std::move() do under the hood is what I can't visualize and understand. Can somebody point to a resource that makes it clear. I have tried a couple of blogs but all I get is that std::move() is just type casting lvale ref to rvalue ref, it is not moving anything. So what is the advantage? Specifically, I don't understand the section of code circled in red.
The book I am following is C++ primer (5th edition).
Thank you