Things that keep D from evolving?

Ola Fosheim Grøstad via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Feb 6 09:36:28 PST 2016


On Saturday, 6 February 2016 at 17:22:03 UTC, Adam D. Ruppe wrote:
> On Saturday, 6 February 2016 at 11:15:06 UTC, Ola Fosheim 
> Grøstad wrote:
>> Nothing prevents you from creating your own reference counting 
>> mechanism.
>
> A struct wrapper doesn't give the things you need to reliably 
> handle inheritance.

I don't think I suggested using a struct wrapper? :-) That just 
cause issues with alignment or requires a more complex allocator.

You can either build the refcount into the root class or use an 
extra indirection like C++'s shared_ptr.



More information about the Digitalmars-d-learn mailing list