Hacker News new | ask | show | jobs
by antirez 4853 days ago
I was referring about how to do it with C.
2 comments

Hi antirez

C doesn't have a destructor that gets called when something goes out of scope. That's taken advantage of in C++ (RAII) to implement various things (like scoped_ptr that helps avoid leaks).

Refcounting is also not perfect for every case.

But I like and prefer C. ;) Just pointing out one thing different in C++.

How is a C implementation of std::shared_ptr safer?