Skip to content

std::vector

M. Bai edited this page Nov 18, 2020 · 2 revisions

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

Clone this wiki locally