mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 01:38:36 +00:00
COMMON: Add DisposablePtr constructor with move semantics
This allows easy move from one DisposablePtr to another
This commit is contained in:
parent
93283634aa
commit
8d722dc3c1
@ -657,6 +657,10 @@ public:
|
||||
typedef T &ReferenceType;
|
||||
|
||||
explicit DisposablePtr(PointerType o, DisposeAfterUse::Flag dispose) : _pointer(o), _dispose(dispose) {}
|
||||
DisposablePtr(DisposablePtr<T>&& o) : _pointer(o._pointer), _dispose(o._dispose) {
|
||||
o._pointer = nullptr;
|
||||
o._dispose = DisposeAfterUse::NO;
|
||||
}
|
||||
|
||||
~DisposablePtr() {
|
||||
if (_dispose) DL()(_pointer);
|
||||
|
Loading…
x
Reference in New Issue
Block a user