Is the following an example of iterator invalidation?
int main() {
std::vector<int> v = {1, 2, 3};
auto it = v.begin();
v.push_back(4);
std::cout << *it << std::endl;
}
The code prints 0. I assume it's because the iterator has been invalidated? Is that correct?