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
resize()
reserve()
No. pop_back() will not shrink the capacity of vector. use std::vector(v).swap(v) instead.
std::vector(v).swap(v)