On Monday, 20 October 2014 at 09:01:15 UTC, Marco Leise wrote:
Moving the reference count out, means that as soon as you add
another immutable layer around the object, it is in the way
again. And at that point you turn to "looking it up" instead

c++ shared_ptr is implemented as a separate object, an extra indirection, but this indirection also makes weak_ptr and ref-counting immutable possible.

In performant code you only use shared_ptr to obtain ownership for a thread and raw pointers after that.

Reply via email to