From ecdeec99486469c7ae4ebd39483ecd3cf13b9411 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Thu, 24 Jul 2014 07:41:23 +0900 Subject: [PATCH] Fixed the move assign operator implementation. --- include/msgpack/unpack.hpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/include/msgpack/unpack.hpp b/include/msgpack/unpack.hpp index e17a1fee..8e2a3462 100644 --- a/include/msgpack/unpack.hpp +++ b/include/msgpack/unpack.hpp @@ -955,16 +955,8 @@ inline unpacker::unpacker(unpacker&& other) } inline unpacker& unpacker::operator=(unpacker&& other) { - m_buffer = other.m_buffer; - m_used = other.m_used; - m_free = other.m_free; - m_off = other.m_off; - m_parsed = other.m_parsed; - m_z = other.m_z; - m_initial_buffer_size = other.m_initial_buffer_size; - m_ctx = msgpack::move(other.m_ctx); - other.m_buffer = nullptr; - other.m_z = nullptr; + std::swap(m_z, other.m_z); + std::swap(m_buffer, other.m_buffer); return *this; }