Postblit bug

via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 20 02:49:31 PDT 2014


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.


More information about the Digitalmars-d mailing list