diff --git a/BAN/include/BAN/UniqPtr.h b/BAN/include/BAN/UniqPtr.h index c22a1b7c..96dbd399 100644 --- a/BAN/include/BAN/UniqPtr.h +++ b/BAN/include/BAN/UniqPtr.h @@ -14,7 +14,8 @@ namespace BAN public: UniqPtr() = default; - UniqPtr(UniqPtr&& other) + template + UniqPtr(UniqPtr&& other) { m_pointer = other.m_pointer; other.m_pointer = nullptr; @@ -42,8 +43,10 @@ namespace BAN return uniq; } - UniqPtr& operator=(UniqPtr&& other) + template + UniqPtr& operator=(UniqPtr&& other) { + clear(); m_pointer = other.m_pointer; other.m_pointer = nullptr; return *this; @@ -87,6 +90,9 @@ namespace BAN private: T* m_pointer = nullptr; + + template + friend class UniqPtr; }; } \ No newline at end of file