3 ms·
Actually you'd have to try harder: even this might leave the current capacity unchanged. The blessed idiom is vec.swap(std::vector<T>()); c++11 added shrink_to
by pragmatib 11y ago
Actually you'd have to try harder: even this might leave the current capacity unchanged. The blessed idiom is vec.swap(std::vector<T>());
c++11 added shrink_to_fit which is a non binding request to reduce capacity.