From 371f3ba371355ef204bf26bfe8aac962cebc1e4c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 16 Jan 2024 04:46:41 +0100 Subject: b --- compat/safe-ptr.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'compat') 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); -- cgit v1.2.3