diff --git a/src/common/StackStringStream.h b/src/common/StackStringStream.h index 522abc0749a..352b545d4bc 100644 --- a/src/common/StackStringStream.h +++ b/src/common/StackStringStream.h @@ -92,7 +92,7 @@ template class StackStringStream : public std::basic_ostream { public: - StackStringStream() : basic_ostream(&ssb) {} + StackStringStream() : basic_ostream(&ssb), default_fmtflags(flags()) {} StackStringStream(const StackStringStream& o) = delete; StackStringStream& operator=(const StackStringStream& o) = delete; StackStringStream(StackStringStream&& o) = delete; @@ -101,6 +101,7 @@ public: void reset() { clear(); /* reset state flags */ + flags(default_fmtflags); /* reset fmtflags to constructor defaults */ ssb.clear(); } @@ -110,6 +111,7 @@ public: private: StackStringBuf ssb; + fmtflags const default_fmtflags; }; /* In an ideal world, we could use StackStringStream indiscriminately, but alas