diff --git a/src/core-io/include/units/quantity_io.h b/src/core-io/include/units/quantity_io.h index b4081ebb..cb93f686 100644 --- a/src/core-io/include/units/quantity_io.h +++ b/src/core-io/include/units/quantity_io.h @@ -53,12 +53,12 @@ std::basic_ostream& operator<<(std::basic_ostream& { if (os.width()) { // std::setw() applies to the whole quantity output so it has to be first put into std::string - std::basic_ostringstream s; - s.flags(os.flags()); - s.imbue(os.getloc()); - s.precision(os.precision()); - detail::to_stream(s, q); - return os << s.str(); + std::basic_ostringstream oss; + oss.flags(os.flags()); + oss.imbue(os.getloc()); + oss.precision(os.precision()); + detail::to_stream(oss, q); + return os << std::move(oss).str(); } detail::to_stream(os, q);