std::vector reallocation invalidation
Which iterators/references are guaranteed valid after v.push_back(4) in this code?
std::vector<int> v = {1, 2, 3};
auto it = v.begin();
int& ref = v[0];
v.push_back(4);
Sign in to answer questions and track your progress
Sign In