1

I have rather simple code but probably complex question.

std::vector<int> V;
///.. code that uses vector
V.push_back(V.back());

Is this call of push_back undefined behaviour?
The problem really relates the case when vector is full, will it reallocate and somehow invalidates or changes back?

Eduard Rostomyan
  • 7,050
  • 2
  • 37
  • 76

0 Answers0