diff --git a/io_posix.cpp b/io_posix.cpp index ccb75d68..1a979f18 100644 --- a/io_posix.cpp +++ b/io_posix.cpp @@ -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 () { diff --git a/io_posix.hpp b/io_posix.hpp index 196d63e0..9d165097 100644 --- a/io_posix.hpp +++ b/io_posix.hpp @@ -45,7 +45,7 @@ namespace cruft { mapped_file (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 ();