File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#include " Log.hpp"
22
33namespace Log {
4- StreamTerminator::StreamTerminator (std::ostream& stream) noexcept : stream(stream) {}
4+ StreamTerminator::StreamTerminator (std::ostream& stream) noexcept
5+ : stream(stream) {
6+ this ->state .copyfmt (stream);
7+ }
58
6- StreamTerminator::StreamTerminator (StreamTerminator&& other) noexcept : stream(other.stream) {
9+ StreamTerminator::StreamTerminator (StreamTerminator&& other) noexcept
10+ : stream(other.stream) {
11+ this ->state .copyfmt (other.state );
712 other.terminate = false ;
813 }
914
1015 StreamTerminator::~StreamTerminator () {
1116 if (this ->terminate ) {
1217 this ->stream << std::endl;
18+ this ->stream .copyfmt (this ->state );
1319 }
1420 }
1521
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ namespace Log {
77 private:
88 std::ostream& stream;
99 bool terminate = true ;
10+
11+ std::ios state = std::ios(nullptr );
1012 public:
1113 explicit StreamTerminator (std::ostream& stream) noexcept ;
1214 ~StreamTerminator ();
You can’t perform that action at this time.
0 commit comments