From ffa2f33886f3e67fd05cc4576f3534ad1c6f04ea Mon Sep 17 00:00:00 2001 From: Francis <455954986@qq.com> Date: Sat, 3 Apr 2021 17:27:34 +0800 Subject: [PATCH] Update README.md --- 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; } }