io_win32: add move operators to mapped_file
This commit is contained in:
parent
332d28614b
commit
a50624340e
13
io_win32.cpp
13
io_win32.cpp
@ -144,6 +144,19 @@ mapped_file::mapped_file (cruft::posix::fd const &src,
|
|||||||
{ };
|
{ };
|
||||||
|
|
||||||
|
|
||||||
|
static BOOL noop (LPCVOID) { return TRUE; }
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
mapped_file::mapped_file (mapped_file &&rhs) noexcept
|
||||||
|
: m_data (nullptr, noop)
|
||||||
|
{
|
||||||
|
std::swap (m_file, rhs.m_file);
|
||||||
|
std::swap (m_mapping, rhs.m_mapping);
|
||||||
|
std::swap (m_data, rhs.m_data);
|
||||||
|
std::swap (m_size, rhs.m_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
size_t
|
size_t
|
||||||
mapped_file::size (void) const
|
mapped_file::size (void) const
|
||||||
|
@ -70,6 +70,9 @@ 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 (mapped_file&&) noexcept;
|
||||||
|
mapped_file& operator= (mapped_file&&) noexcept;
|
||||||
|
|
||||||
size_t size (void) const;
|
size_t size (void) const;
|
||||||
bool empty (void) const;
|
bool empty (void) const;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user