[Bug libstdc++/32068] vector push_back()/resize() causes assignment to deleted memory
fang at csl dot cornell dot edu
gcc-bugzilla@gcc.gnu.org
Thu May 24 18:55:00 GMT 2007
------- Comment #2 from fang at csl dot cornell dot edu 2007-05-24 19:55 -------
Suggestion: determine some lower bound of the size (or exact) N prior to a
sequence of push_back()s, and call vector::reserve(N) in advance. Then as long
as the capacity isn't exceeded, you avoid any reallocation.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32068
More information about the Gcc-bugs
mailing list