3 ms·
Fwiw, they seem to imply (admit) that you can get precise growth using s.reserve(n); // precise allocation. s.resize(n); // doesn't grow. or s.r
by rerdavies 3y ago
Fwiw, they seem to imply (admit) that you can get precise growth using
s.reserve(n); // precise allocation.
s.resize(n); // doesn't grow.
or
s.reserve(n);
s.append(....); // a fairly robust set of overloads.
That being said... I completely agree that imprecise resize() is unfortunate, and unexpected. I'm going to have to keep an eye out for how I use resize() going forward. (Not a lot, admittedly).