From the remarks on vector::reserve()
in C++11 23.3.6.3 "vector capacity":
It is guaranteed that no reallocation takes place during insertions that happen after a call to
reserve()
until the time when an insertion would make the size of the vector greater than the value ofcapacity()
.