Add element at the end Adds a new element at the end of the vector, after its current last element. The content of val is copied (or moved) to the new element.
Hi, the above is from http://www.cplusplus.com/reference/vector/vector/push_back/
I am a little bit confused by the word "move".I understand the rvalue reference and lvalue reference.
for example,
vector<int> source = {1,2,3};
vector<int> copy;
copy.push_back(source[0]);
cout<<source[0]; // why it doesn't throw error since source[0] is moved to copy ?
because source[0] is rvalue, so push_back actually moves source[0] rather than copy it. Then after this operator, access to source[0] is still valid? why?