diff --git a/luna/include/luna/SharedPtr.h b/luna/include/luna/SharedPtr.h index 8197f4ab..020c37a5 100644 --- a/luna/include/luna/SharedPtr.h +++ b/luna/include/luna/SharedPtr.h @@ -123,20 +123,6 @@ template Result> adopt_shared(T* ptr) return SharedPtr { ptr, ref_count }; } -// NOTE: ptr is deleted if any of the adopt_shared* functions fail to construct a SharedPtr. -template Result> adopt_shared(T* ptr) -{ - using RefCount = __detail::RefCount; - - auto guard = make_scope_guard([ptr] { delete ptr; }); - - RefCount* const ref_count = TRY(make()); - - guard.deactivate(); - - return SharedPtr { ptr, ref_count }; -} - template Result> make_shared(Args... args) { T* raw_ptr = TRY(make(args...));