When is a class's destructor called?

Mike none at none.com
Sun Dec 29 14:34:18 PST 2013


On Sunday, 29 December 2013 at 14:24:05 UTC, bearophile wrote:
> Ali Çehreli:
>
>> On 12/29/2013 04:00 AM, Mike:
>>> Do you happen to know of any clever technique to make object, 
>>> and
>>> everything that inherits from it, a referenced counted object?
>>
>> There is std.typecons.RefCounted:
>>
>>  http://dlang.org/phobos/std_typecons.html#.RefCounted
>
> I think it only works on a single object, not on the whole tree.
>
> (And I think RefCounted is not used often in D.)
>
> Bye,
> bearophile

Yep, and it's a struct, so no inheritance.


More information about the Digitalmars-d-learn mailing list