#include #include int main() { std::vector v { 1, 2, 3, 4 }; v.reserve(5); std::cout << "capacity: " << v.capacity() << std::endl; v.reserve(10); std::cout << "capacity: " << v.capacity() << std::endl; v.reserve(5); std::cout << "capacity: " << v.capacity() << std::endl; v.shrink_to_fit(); std::cout << "capacity: " << v.capacity() << std::endl; }