Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Managing memory in C is difficult and error prone. C++ solves this with smart pointers like std::unique_ptr and std::shared_ptr.

No, it does not. Smart pointers are useful to help model lifetimes and ownership, but the real killer feature is RAII. Add that to C (standardized) and you can make smart pointers, and any other memory management primitive you need. Smart pointers are not a solution, they are one of many tools enabled by RAII.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: