diff options
Diffstat (limited to 'compat/safe-ptr.hpp')
| -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); |
