From ccc99e41206d2f04405b3fcbf6be122ed3b8b8cd Mon Sep 17 00:00:00 2001 From: Matthieu Dorier Date: Wed, 8 Aug 2018 14:59:45 +0200 Subject: [PATCH] added move-constructor to async_response --- include/thallium/async_response.hpp | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/include/thallium/async_response.hpp b/include/thallium/async_response.hpp index c506da5..cc488d8 100644 --- a/include/thallium/async_response.hpp +++ b/include/thallium/async_response.hpp @@ -50,6 +50,37 @@ private: public: + /** + * @brief Copy constructor is deleted. + */ + async_response(const async_response& other) = delete; + + /** + * @brief Move-constructor. + * + * @param other async_response to move from. + */ + async_response(async_response&& other) + : m_request(other.m_request) + , m_engine(other.m_engine) + , m_handle(other.m_handle) + , m_buffer(std::move(other.m_buffer)) + , m_ignore_response(other.m_ignore_response) { + other.m_request = MARGO_REQUEST_NULL; + other.m_engine = nullptr; + other.m_handle = HG_HANDLE_NULL; + } + + /** + * @brief Copy-assignment operator is deleted. + */ + async_response& operator=(const async_response& other) = delete; + + /** + * @brief Move-assignment operator is deleted. + */ + async_response& operator=(async_response&& other) = delete; + /** * @brief Destructor. */ -- 2.26.2