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.