From 31f6a18f37c3c481bc495fd29fa629dce5f4b0ad Mon Sep 17 00:00:00 2001 From: Michael van der Werve Date: Fri, 31 Aug 2018 14:44:19 +0200 Subject: [PATCH] channel should be movable --- include/amqpcpp/channel.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/amqpcpp/channel.h b/include/amqpcpp/channel.h index 253b68c..046fb14 100644 --- a/include/amqpcpp/channel.h +++ b/include/amqpcpp/channel.h @@ -22,9 +22,9 @@ class Channel private: /** * The implementation for the channel - * @var ChannelImpl + * @var std::unique_ptr */ - std::shared_ptr _implementation; + std::unique_ptr _implementation; public: /** @@ -47,6 +47,12 @@ public: */ Channel(const Channel &channel) = delete; + /** + * But movement _is_ allowed + * @param channel + */ + Channel(Channel &&channel) : _implementation(std::move(channel._implementation)) {} + /** * Destructor */