From 92ff1ecc07e43c322c531af1d495ff1ea2539cb4 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Fri, 12 May 2023 12:29:48 +0200 Subject: [PATCH] fix: MSVC 14.3 complained about shadowing a symbol of second with local variable `s` --- src/core-io/include/units/quantity_io.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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);