On Monday, 27 November 2017 at 18:00:59 UTC, Jonathan M Davis wrote:
I don't understand this. I would expect most modern C++ programs to be using shared_ptr as the default for most pointers and thus use it heavily.

You get this:

shared_ptr -> control_block -> object

Instead of this:

unique_ptr -> object
my_ref_ptr ->object


shared_ptr is a _huge_ boon for avoiding memory problems.

Yes, if you don't mind the inefficiency, i.e. if you are doing high-level programming in C++.


Reply via email to