diff options
author | Matthias Maennich <matthias@maennich.net> | 2017-10-04 17:02:56 (GMT) |
---|---|---|
committer | Matthias Maennich <matthias@maennich.net> | 2017-10-05 12:50:25 (GMT) |
commit | 3345e2a2cc16e209f6e37caffe581b40e6ed19bb (patch) | |
tree | af3d10674e1b1b759f97222877bcdd52b5d281f1 /Source/cmcmd.cxx | |
parent | 4ffa4ddd8078918583fc03302fa3c3db2c1ca733 (diff) | |
download | CMake-3345e2a2cc16e209f6e37caffe581b40e6ed19bb.zip CMake-3345e2a2cc16e209f6e37caffe581b40e6ed19bb.tar.gz CMake-3345e2a2cc16e209f6e37caffe581b40e6ed19bb.tar.bz2 |
cmcmd: let operator<< for NumberFormatter reset the stream's format flags
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r-- | Source/cmcmd.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index c0c7d03..ed507fd 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -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, |