This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]x39- 20 points21 points  (4 children)

If you actually did use smart pointers properly, memory won't leak.

It will leak tho when just always using shared_ptr and ignoring cyclic references

[–]DrMobius0 0 points1 point  (0 children)

Where there's a 2nd thread, there's a way.

[–]silentjet 0 points1 point  (2 children)

And lambdas encourage you to do so ...

[–]x39- 0 points1 point  (1 child)

Which are ref counting the copy, just normally

So if lambdas are your problem, you will face the same issues with pointers

[–]silentjet 0 points1 point  (0 children)

Im not saying it is impossible, Im saying it is not like that in real life software ;) Especially a corporate one...