io;posix: implement move constructor for mapped_file

This commit is contained in:
Danny Robson 2019-01-17 19:49:45 +11:00
parent f51beedcdd
commit 26841db5e0
2 changed files with 8 additions and 1 deletions

View File

@ -44,6 +44,13 @@ mapped_file::mapped_file (const ::cruft::posix::fd &src, int mflags)
} }
//-----------------------------------------------------------------------------
mapped_file::mapped_file (cruft::mapped_file &&rhs) noexcept
: m_data (std::exchange (rhs.m_data, nullptr))
, m_size (std::exchange (rhs.m_size, 0))
{ ; }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
mapped_file::~mapped_file () mapped_file::~mapped_file ()
{ {

View File

@ -45,7 +45,7 @@ namespace cruft {
mapped_file (const mapped_file&) = delete; mapped_file (const mapped_file&) = delete;
mapped_file& operator= (const mapped_file&) = delete; mapped_file& operator= (const mapped_file&) = delete;
mapped_file (const mapped_file&&) noexcept; mapped_file (mapped_file&&) noexcept;
mapped_file& operator= (mapped_file&&) noexcept; mapped_file& operator= (mapped_file&&) noexcept;
~mapped_file (); ~mapped_file ();