std::vector - Serbipunk/notes GitHub Wiki

emplace_back

看起来像是默认构造函数进行插入,比push_back省略了拷贝函数的开销

https://zh.cppreference.com/w/cpp/container/vector/emplace_back

shrink_to_fit

请求移除未使用的容量。

https://zh.cppreference.com/w/cpp/container/vector/shrink_to_fit