Skip to content

Commit ffa2f33

Browse files
authored
Update README.md
1 parent ea416ee commit ffa2f33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

design_pattern/singleton/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ singleton *instance() {
185185
lock_guard<mutex> guard(lock_);
186186
if (p == nullptr) {
187187
singleton *tmp = static_cast<singleton *>(operator new(sizeof(singleton)));
188-
new(p)singleton();
188+
new(tmp)singleton();
189189
p = tmp;
190190
}
191191
}

0 commit comments

Comments
 (0)