News for hackers. Stuff that matters.
Re:A Defer Mechanism for C by eropple on Monday December 14, 2020 @02:59PM (#25422415)
"Fine" is probably pushing it, but "not the biggest problem you are likely to have" is probably true. But, like, it's easy to accidentally get yourself into situations where somebody forgot to use std::weak_ptr somewhere and you start leaking memory.

Unless you know you must share objects with multiple potential owners, though, std::unique_ptr is a lot wiser.

Re:A Defer Mechanism for C by Arnavion on Monday December 14, 2020 @03:01PM (#25422446)
Yes, when I wrote:

>but also the value is trivial enough that it doesn't matter when it's destroyed or what it does when it's destroyed"

that precludes the value from having other refcounting pointers that could then create cycles and leak.