Hacker News new | ask | show | jobs
by tpolzer 1415 days ago
unique_ptr is nearly overhead free compared to a bare pointer (except for argument passing... because of ABI concerns).

shared_ptr is expensive and easy to build leaks with, so a lot of code bases avoid it where possible. Though it's only expensive when you copy it, moving it is ~free.

1 comments

This is just a more detailed version of my point lol you just listed the reasons they are not free.