cmcmd: let operator<< for NumberFormatter reset the stream's format flags

This commit is contained in:
Matthias Maennich committed 2017-10-05 14:50:25 +02:00
1 parent 4ffa4ddd80
commit 3345e2a2cc
1 file changed
+3 -1
+3 -1
View File
@@ -1556,11 +1556,13 @@ struct NumberFormatter
std::ostream& operator<<(std::ostream& stream,
NumberFormatter const& formatter)
{
auto const& flags = stream.flags();
if (formatter.Format == FORMAT_DECIMAL) {
stream << formatter.Value;
stream << std::dec << formatter.Value;
} else {
stream << "0x" << std::hex << formatter.Value;
}
stream.flags(flags);
return stream;
}
static bool RunCommand(const char* comment, std::vector<std::string>& command,