From 757feb10c639706491feabe0f67ff4a22716ae83 Mon Sep 17 00:00:00 2001 From: Michael van der Werve Date: Fri, 31 Aug 2018 15:01:10 +0200 Subject: [PATCH] tcpchannel should also be movable --- include/amqpcpp/channel.h | 2 +- include/amqpcpp/linux_tcp/tcpchannel.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/amqpcpp/channel.h b/include/amqpcpp/channel.h index 046fb14..e5ebe84 100644 --- a/include/amqpcpp/channel.h +++ b/include/amqpcpp/channel.h @@ -24,7 +24,7 @@ private: * The implementation for the channel * @var std::unique_ptr */ - std::unique_ptr _implementation; + std::shared_ptr _implementation; public: /** diff --git a/include/amqpcpp/linux_tcp/tcpchannel.h b/include/amqpcpp/linux_tcp/tcpchannel.h index e8b5db1..d48c7b5 100644 --- a/include/amqpcpp/linux_tcp/tcpchannel.h +++ b/include/amqpcpp/linux_tcp/tcpchannel.h @@ -38,6 +38,18 @@ public: * Destructor */ virtual ~TcpChannel() {} + + /** + * Copying is not allowed. + * @param other + */ + TcpChannel(const TcpChannel &other) = delete; + + /** + * But movement is allowed + * @param other + */ + TcpChannel(TcpChannel &&other) = default; }; /**