https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85308
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- That's not a bug, it's how stringstream is supposed to work. Use std::stringstream con(BEFORE, std::ios::in|std::ios::out|std::ios::ate); if you want insertions to happen at the end, after the initial value.