首页
Python
Java
前端
数据库
Linux
Chatgpt专题
开发者工具箱
excess专题
Effective STL 17 Use the swap trick to trim excess capacity
for vector vector<int>(v.begin(), v.end()).swap(v); for string string(s.begin(), s.end()).swap(s); both to clear a container and to reduce its capacity to the minmum your implementation offers. v
阅读更多...