3 ms·
> About the best you can do is if you know beforehand roughly how big it will be, is to reserve that capacity with std::vector::reserve(). But be careful not t
by account42 5y ago
> About the best you can do is if you know beforehand roughly how big it will be, is to reserve that capacity with std::vector::reserve().
But be careful not to call reserve() in a loop adding data to a vector - will allocated exactly what you request and not do exponential growth.