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; } }