mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-24 13:43:43 +00:00
Delete assignment and copy constructor
This commit is contained in:
parent
3c8ef8463c
commit
8a724eb772
@ -34,8 +34,21 @@ namespace Platform::File {
|
||||
Handle mHandle{ Handle::Invalid };
|
||||
|
||||
public:
|
||||
ScopedHandle() = default;
|
||||
ScopedHandle(Handle handle) : mHandle(handle) {}
|
||||
ScopedHandle() noexcept = default;
|
||||
ScopedHandle(ScopedHandle& other) = delete;
|
||||
ScopedHandle(Handle handle) noexcept : mHandle(handle) {}
|
||||
ScopedHandle(ScopedHandle&& other) noexcept
|
||||
: mHandle(other.mHandle)
|
||||
{
|
||||
other.mHandle = Handle::Invalid;
|
||||
}
|
||||
ScopedHandle& operator=(const ScopedHandle& other) = delete;
|
||||
ScopedHandle& operator=(ScopedHandle&& other) noexcept
|
||||
{
|
||||
mHandle = other.mHandle;
|
||||
other.mHandle = Handle::Invalid;
|
||||
return *this;
|
||||
}
|
||||
~ScopedHandle()
|
||||
{
|
||||
if(mHandle != Handle::Invalid)
|
||||
|
Loading…
x
Reference in New Issue
Block a user