wenfh2020 / wenfh2020.github.io

make blog : github + jekyll
MIT License
4 stars 3 forks source link

[stl 源码分析] std::vector::push_back 内存扩充 #129

Open wenfh2020 opened 2 years ago

wenfh2020 commented 2 years ago

https://wenfh2020.com/2021/04/20/stl-vector-push_back/

std::vector::push_back 内存是如何动态增长的:增加新元素,如果超过当时的容量,则容量会扩充至原来的两倍。