Fix compiling error when message doesn't have a move constructor.

This commit is contained in:
Xie Han
2025-01-07 02:00:47 +08:00
parent 427ad1ed87
commit d9186d13d1

View File

@@ -179,9 +179,10 @@ protected:
void clear_resp()
{
RESP resp;
*(protocol::ProtocolMessage *)&resp = std::move(this->resp);
this->resp = std::move(resp);
protocol::ProtocolMessage head(std::move(this->resp));
this->resp.~RESP();
new(&this->resp) RESP;
*(protocol::ProtocolMessage *)&this->resp = std::move(head);
}
void disable_retry()