channel should be movable

This commit is contained in:
Michael van der Werve 2018-08-31 14:44:19 +02:00
parent 3d33332c23
commit 31f6a18f37
1 changed files with 8 additions and 2 deletions

View File

@ -22,9 +22,9 @@ class Channel
private: private:
/** /**
* The implementation for the channel * The implementation for the channel
* @var ChannelImpl * @var std::unique_ptr<ChannelImpl>
*/ */
std::shared_ptr<ChannelImpl> _implementation; std::unique_ptr<ChannelImpl> _implementation;
public: public:
/** /**
@ -47,6 +47,12 @@ public:
*/ */
Channel(const Channel &channel) = delete; Channel(const Channel &channel) = delete;
/**
* But movement _is_ allowed
* @param channel
*/
Channel(Channel &&channel) : _implementation(std::move(channel._implementation)) {}
/** /**
* Destructor * Destructor
*/ */