win32/file: add move operators
This commit is contained in:
parent
5fa4704456
commit
332d28614b
@ -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)))
|
||||
|
@ -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&&);
|
||||
|
Loading…
Reference in New Issue
Block a user