I am trying to understand the behavior of vector::pop_back() . Therefore, I have the following code snippet:
vector<int> test; test.push_back(1); test.pop_back(); cout << test.front() << endl;
This may be right, but it surprises me that it prints 1. So I'm confused. Does pop_back() only have a way to remove an index > 0 element?
Thanks in advance!
source share