4 ms·
That's exactly the purpose of std::vector's “reserve“ method, btw.
by spacechild1 6y ago
That's exactly the purpose of std::vector's “reserve“ method, btw.
- twoodfin 6y agoI once worked with a C++ text processing library that saw more than a 50% throughput bump just from reserve()’ing std::string and std::vector space in hot code paths.