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

> You should almost always be using unique_ptr or shared_ptr

I really wish there was a thread unsafe version of shared pointers, without atomics overhead, in the standard. Maybe without weak pointers.



If there's one thing C++ needs, it's more slightly-different varieties of smart pointers in the standard. ;-)

What exactly would you use these for? I find that usually I can get away with unique_ptr for the sort of object that I have many of where pointer performance matters.


Some sort of problems where you throw trees around. Almost interpreter like programs, where trees are arbitrarily stored on different places. And where you for some reason don't want a proper GC ...




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: