diff --git a/alib2std/src/extensions/memory.hpp b/alib2std/src/extensions/memory.hpp index 31c0f82664cbd3666a2f98f242aabd2cc6811722..da1fdd790d8d477541976d4e4caf9d582ec630cc 100644 --- a/alib2std/src/extensions/memory.hpp +++ b/alib2std/src/extensions/memory.hpp @@ -270,12 +270,14 @@ public: explicit smart_ptr ( T * data ) : m_Data ( data ) { } + template < class R > + smart_ptr ( smart_ptr < R > other ) : m_Data ( other.release ( ) ) { + } + smart_ptr ( const smart_ptr < T > & other ) : m_Data ( std::clone ( other.m_Data ) ) { } - smart_ptr ( smart_ptr < T > && other ) noexcept { - m_Data = other.m_Data; - other.m_Data = NULL; + smart_ptr ( smart_ptr < T > && other ) noexcept : m_Data ( other.release ( ) ) { } ~smart_ptr ( ) noexcept {