Things that keep D from evolving?

Ola Fosheim Grøstad via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Feb 6 03:15:06 PST 2016


On Saturday, 6 February 2016 at 11:09:28 UTC, NX wrote:
> On Saturday, 6 February 2016 at 10:29:32 UTC, Ola Fosheim 
> Grøstad wrote:
>>> What makes it impossible to have ref counted classes?
>>
>> Nothing.
>
> Then why do we need DIP74 ?

I think they aim for compiler optimizations, like ARC on Swift. 
But ARC requires all ref counting to be done behind the scene, so 
I think it is a bad idea for D to be honest.

> And why documentation says RefCounted doesn't work with classes?

I don't use Phobos much. I think RefCounted creates a wrapper for 
an embedded struct or something. Something like struct { int 
refcount; T payload; }

Nothing prevents you from creating your own reference counting 
mechanism.



More information about the Digitalmars-d-learn mailing list