From a4d7876d71974b269c2aea925560640d4a437a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven=20Dee=20=28J=C5=8Dshin=29?= Date: Sat, 14 Sep 2024 20:25:22 -0700 Subject: [PATCH] make_shared should work with nontrivial objects --- ctl/shared_ptr.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ctl/shared_ptr.h b/ctl/shared_ptr.h index ae3316831d1..317374bfd65 100644 --- a/ctl/shared_ptr.h +++ b/ctl/shared_ptr.h @@ -147,6 +147,10 @@ class shared_emplace : public shared_ref T t; }; + ~shared_emplace() override + { + } + template void construct(Args&&... args) { @@ -159,7 +163,9 @@ class shared_emplace : public shared_ref } private: - explicit constexpr shared_emplace() noexcept = default; + explicit constexpr shared_emplace() noexcept + { + } void dispose() noexcept override {