Does std::vector.pop_back() change vector's capacity?

后端 未结 6 1557
情深已故
情深已故 2020-12-09 11:04

If I allocated an std::vector to a certain size and capacity using resize() and reserve() at the beginning of my program, is it possible that

6条回答
  •  鱼传尺愫
    2020-12-09 11:32

    pop_XXX will never change the capacity. push_XXX can change the capacity if you try to push more stuff on than the capacity allows.

提交回复
热议问题