Core: Add MovablePtr class

This commit is contained in:
Lynix
2017-09-30 13:57:25 +02:00
parent f95fc332f1
commit 2cd9fa2b7a
29 changed files with 157 additions and 259 deletions

View File

@@ -40,19 +40,6 @@ namespace Nz
{
}
/*!
* \brief Constructs a DynLib object by move semantic
*
* \param lib DynLib to move into this
*/
DynLib::DynLib(DynLib&& lib) :
m_lastError(std::move(lib.m_lastError)),
m_impl(lib.m_impl)
{
lib.m_impl = nullptr;
}
/*!
* \brief Destructs the object and calls Unload
*
@@ -150,23 +137,4 @@ namespace Nz
m_impl = nullptr;
}
}
/*!
* \brief Moves the other lib into this
* \return A reference to this
*
* \param lib DynLib to move in this
*/
DynLib& DynLib::operator=(DynLib&& lib)
{
Unload();
m_impl = lib.m_impl;
m_lastError = std::move(lib.m_lastError);
lib.m_impl = nullptr;
return *this;
}
}