vector<int>().swap(xxx)
by limuy @ 2024-03-20 17:45:29
```cpp
vector<int>().swap(vecInt); //清除容器并最小化其容量
```
@[smallpeople](/user/654763)
by qwq2011 @ 2024-03-20 17:46:34
@[smallpeople](/user/654763) 对象名.shrink_to_fit();
by dxzier @ 2024-03-20 17:51:32