Another fun way STL containers can be misused is not understanding the underlying memory management enough. Growing an std::vector by naively pushing elements and letting the container grow automatically is much, much slower than pre-allocating if you know the roughly how large your data set will be.
Another fun way STL containers can be misused is not understanding the underlying memory management enough. Growing an
std::vector
by naively pushing elements and letting the container grow automatically is much, much slower than pre-allocating if you know the roughly how large your data set will be.That's right, I fully agree.