mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2026-04-27 04:41:45 +00:00
refactor(cleanup): fix pointer implementation
This commit is contained in:
parent
18b01050eb
commit
3fc830ad0c
1 changed files with 4 additions and 1 deletions
|
|
@ -34,13 +34,16 @@ namespace ls {
|
||||||
T* operator->() const { return &this->get(); }
|
T* operator->() const { return &this->get(); }
|
||||||
|
|
||||||
// moveable
|
// moveable
|
||||||
owned_ptr(owned_ptr&& other) noexcept : ptr(other.ptr) {
|
owned_ptr(owned_ptr&& other) noexcept :
|
||||||
|
ptr(other.ptr),
|
||||||
|
deleter(std::move(other.deleter)) {
|
||||||
other.ptr = nullptr;
|
other.ptr = nullptr;
|
||||||
}
|
}
|
||||||
owned_ptr& operator=(owned_ptr&& other) noexcept {
|
owned_ptr& operator=(owned_ptr&& other) noexcept {
|
||||||
if (this != &other) {
|
if (this != &other) {
|
||||||
ptr = other.ptr;
|
ptr = other.ptr;
|
||||||
other.ptr = nullptr;
|
other.ptr = nullptr;
|
||||||
|
deleter = std::move(other.deleter);
|
||||||
}
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue