Hacker News new | ask | show | jobs
by rjinman 389 days ago
unique_ptr is much better because then each object has a sole owner, which makes object lifetimes much easier to reason about and you can't end up with cyclic references causing memory leaks.