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

They are right that it's harder to reason about value semantics. The cost of passing a pointer is always the same whereas the cost of passing a value isn't.

But I don't think that's a good enough reason not to prefer values considering the performance and memory usage drawbacks of shared_ptr. unique_ptr is often the best solution in my view.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: