Better HN
top
new
best
ask
show
jobs
Log in
Sign up
pragmatib
3 karma · joined Sep 18, 2013 (13y ago) · 1 submissions
Submissions
comment 10y ago ·
link
·
parent
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.