Core: Add MovablePtr class
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user