[Bug libstdc++/52938] std::string::reserve request is not maintained if object is used in other object copy ctore

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 11 21:08:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52938

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-11 21:08:16 UTC ---
N.B. you can get the behaviour you want by calling reserve after creating y

std::string x;
std::string y(x);
x.reserve(20);     /// x capacity is 20



More information about the Gcc-bugs mailing list