Re:A lot of complex “scalable” systems can be done with a si...
by wffurr on Monday December 30, 2019 @08:27AM
(#21913177)
Only use shared_ptr when you actually want shared ownership. If you stick to unique_ptr for owning references and then "borrow" that raw pointer in functions, then you get speed without sacrificing too much safety and still no new/delete.
[ Parent
| on HN ]
Re:A lot of complex “scalable” systems can be done with a si...
by slavik81 on Monday December 30, 2019 @03:10PM
(#21916251)
Additionally, shared ownership should be rare. Most objects should have a single owner that is responsible for them. This is not only better for performance, but also makes the system easier to understand.