diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-16 04:46:41 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-16 04:46:41 +0100 |
commit | 371f3ba371355ef204bf26bfe8aac962cebc1e4c (patch) | |
tree | 09a081d0ec9b322b832e3dfea35a442a72b72a75 /compat | |
parent | c8c86c776483a60b988b18257573009b9897fd6c (diff) |
b
Diffstat (limited to 'compat')
-rw-r--r-- | compat/safe-ptr.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compat/safe-ptr.hpp b/compat/safe-ptr.hpp index ec4a8e02..0882f3be 100644 --- a/compat/safe-ptr.hpp +++ b/compat/safe-ptr.hpp @@ -31,7 +31,7 @@ public: { if (ptr) [[likely]] delete ptr; - ptr = (T*)-0xbadbabe; + ptr = (T*)0xbadcafedeadbabe; } explicit safe_ptr(safe_ptr&& other) noexcept: ptr{other.ptr} @@ -39,6 +39,10 @@ public: other.ptr = nullptr; } + explicit safe_ptr() noexcept: + ptr{new T{}} + {} + safe_ptr& operator=(safe_ptr&& other) noexcept { fm_assert(this != &other); |