Commit f41d989b authored by gabime's avatar gabime

fix in move log_msg

parent 2278e923
...@@ -48,9 +48,7 @@ struct log_msg ...@@ -48,9 +48,7 @@ struct log_msg
level(other.level), level(other.level),
time(other.time), time(other.time),
tm_time(other.tm_time) tm_time(other.tm_time)
{
{
//fmt::MemoryWriter does not allow copy ctor}
raw.write(other.raw.data(), other.raw.size()); raw.write(other.raw.data(), other.raw.size());
formatted.write(other.formatted.data(), other.formatted.size()); formatted.write(other.formatted.data(), other.formatted.size());
} }
...@@ -63,6 +61,7 @@ struct log_msg ...@@ -63,6 +61,7 @@ struct log_msg
raw(std::move(other.raw)), raw(std::move(other.raw)),
formatted(std::move(other.formatted)) formatted(std::move(other.formatted))
{ {
other.clear();
} }
log_msg& operator=(log_msg&& other) log_msg& operator=(log_msg&& other)
...@@ -76,6 +75,7 @@ struct log_msg ...@@ -76,6 +75,7 @@ struct log_msg
tm_time = other.tm_time; tm_time = other.tm_time;
raw = std::move(other.raw); raw = std::move(other.raw);
formatted = std::move(other.formatted); formatted = std::move(other.formatted);
other.clear();
return *this; return *this;
} }
...@@ -83,6 +83,7 @@ struct log_msg ...@@ -83,6 +83,7 @@ struct log_msg
void clear() void clear()
{ {
level = level::OFF;
raw.clear(); raw.clear();
formatted.clear(); formatted.clear();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment