This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] basic_string::reserve() shrink-to-fit?


Jonathan Wakely wrote:

How about a "6. Shrink-to-fit strings" entry in 21_strings/howto.html
that documents the fact that libstdc++ does/will support shrink requests
from 3.4, but not before, and suggesting the alternative below ?

std::string(str.data(), str.size()).swap(str);

Seems to me a really nice idea!


Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]