diff --git a/win32/file.cpp b/win32/file.cpp index 412a7f6e..0a8d1d6b 100644 --- a/win32/file.cpp +++ b/win32/file.cpp @@ -15,6 +15,12 @@ using cruft::win32::file; /////////////////////////////////////////////////////////////////////////////// +file::file () + : m_handle (INVALID_HANDLE_VALUE) +{ ; } + + +//----------------------------------------------------------------------------- file::file (std::filesystem::path const &src, DWORD access, DWORD share, DWORD create, DWORD flags) : m_handle ( error::try_call ( @@ -43,6 +49,14 @@ file::file (handle &&src) noexcept { ; } +//----------------------------------------------------------------------------- +file& file::operator= (file &&rhs) noexcept +{ + std::swap (m_handle, rhs.m_handle); + return *this; +} + + //----------------------------------------------------------------------------- file::file (posix::fd &&src) : file (handle (std::move (src))) diff --git a/win32/file.hpp b/win32/file.hpp index 4f4ddbb2..ba7abb60 100644 --- a/win32/file.hpp +++ b/win32/file.hpp @@ -18,6 +18,7 @@ namespace cruft::win32 { class file { public: + explicit file (); file (std::filesystem::path const &, DWORD access, DWORD share, DWORD create, DWORD flags); explicit file (handle&&) noexcept; explicit file (posix::fd&&);