From c40b848ebf5597d837fecc78096abea96caedd30 Mon Sep 17 00:00:00 2001 From: liukai Date: Sun, 28 Mar 2021 17:13:55 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20placement=20new=20=E5=BA=94=E5=9C=A8?= =?UTF-8?q?=E5=B7=B2=E5=88=86=E9=85=8D=E7=9A=84=E5=86=85=E5=AD=98=E4=B8=8A?= =?UTF-8?q?=E6=9E=84=E9=80=A0=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- design_pattern/singleton/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design_pattern/singleton/README.md b/design_pattern/singleton/README.md index 73bbf40..4601823 100644 --- a/design_pattern/singleton/README.md +++ b/design_pattern/singleton/README.md @@ -185,7 +185,7 @@ singleton *instance() { lock_guard guard(lock_); if (p == nullptr) { singleton *tmp = static_cast(operator new(sizeof(singleton))); - new(p)singleton(); + new(tmp)singleton(); p = tmp; } }