vectro在构造时会按照初始化赋予的元素个数来分配内存空间,这是很好的。但是在阅读《stl源码剖析》后我发现在使用erase后,vector并不会重新分配内存大小。 解决方法是再造一个合适大小的vector,并交换之。例如: v1.swap(v2);
-
Notifications
You must be signed in to change notification settings - Fork 0
VICTORocv/vector
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published