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

@@ -70,20 +70,6 @@ namespace Nz
Open(filePath, openMode);
}
/*!
* \brief Constructs a File object by move semantic
*
* \param file File to move into this
*/
File::File(File&& file) noexcept :
Stream(std::move(file)),
m_filePath(std::move(file.m_filePath)),
m_impl(file.m_impl)
{
file.m_impl = nullptr;
}
/*!
* \brief Destructs the object and calls Close
*
@@ -487,23 +473,6 @@ namespace Nz
return *this;
}
/*!
* \brief Moves the other file into this
* \return A reference to this
*
* \param file File to move in this
*/
File& File::operator=(File&& file) noexcept
{
NazaraLock(m_mutex)
std::swap(m_filePath, file.m_filePath);
std::swap(m_impl, file.m_impl);
return *this;
}
/*!
* \brief Gets the absolute path of the file
* \return Absolute path of the file