Commit 6a4491b2 authored by Damien L-G's avatar Damien L-G

Define move constructor and move assignment operator

parent c3978896
......@@ -33,6 +33,17 @@ public:
RAII() = default;
RAII(RAII const &) = delete;
RAII &operator=(RAII &) = delete;
RAII(RAII &&o) {
this->~RAII();
_p = o._p;
o._p = nullptr;
}
RAII &operator=(RAII &&o) {
this->~RAII();
_p = o._p;
o._p = nullptr;
return *this;
}
operator T *() { return _p; }
operator T const *() const { return _p; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment