Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
sbmassey
· 9y ago · 0 comments
Well of course that is going to leak, but you could instead do std::vector<Person> v; Person p(10); v.emplace_back(p); and be safe
Comments
[–]
hellofunk
9y ago
Emplacing an object that already exists misses the point of emplacement.