mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-09-01 22:59:37 +00:00
Made pimpl objects movable but non-copyable
This commit is contained in:
@ -112,9 +112,14 @@ public:
|
||||
CheshireCat(impl_ptr<T> impl) : mImpl(std::move(impl)) {}
|
||||
template <typename... Args>
|
||||
CheshireCat(Args... args) : mImpl(std::make_shared<T>(std::move(args)...)) {}
|
||||
CheshireCat(CheshireCat<T> &&cc) { *this = std::move(cc); }
|
||||
CheshireCat(const CheshireCat<T> &) = delete;
|
||||
|
||||
virtual ~CheshireCat() = default;
|
||||
|
||||
CheshireCat &operator=(CheshireCat<T> &&cc) { mImpl = std::move(cc->mImpl); };
|
||||
CheshireCat &operator=(const CheshireCat<T> &) = delete;
|
||||
|
||||
protected:
|
||||
impl_ptr<T> impl() { return mImpl; }
|
||||
impl_ptr<const T> impl() const { return mImpl; }
|
||||
|
Reference in New Issue
Block a user