When I call std::vector::reserve, when the identifier is of type std::vector<Foo*> reserve(...)does nothing:
std::vector<int*> bar;
bar.reserve(20);
std::size_t sz = bar.size();
for(std::size_t i = 0; i < sz; ++i) {
}
The above loop forruns exactly at time zero, and bar.size () returns zero. I donβt remember if this is true for all other STL containers, but if so, including the behavior for std :: vector: WHY?
source
share