且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

std::vector Reserve() 和 push_back() 比 resize() 和数组索引快,为什么?

更新时间:2021-11-27 03:35:32

resize 是否初始化新​​分配的向量,而reserve 只分配但不构造?

Does resize initialize the newly allocated vector where reserve just allocates but does not construct?

是的.