Created attachment 43888 [details] -save-temps and example When specifying an initial value in a std::streamstring to resulting value of the item is wrong.
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.