You can just use one ostringstream, and keep streaming to it, with std::endl between each line.