More radical ideas about gc and reference counting

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Thu May 1 18:19:37 PDT 2014


On 5/1/14, 6:06 PM, Walter Bright wrote:
> On 5/1/2014 5:43 PM, Andrei Alexandrescu wrote:
>> For example, we have a File struct. It is entirely legitimate for
>> someone to
>> want to keep a File member variable in a class object. They take care
>> of opening
>> and closing it appropriately. Again, this is 100% legit code to want
>> to write.
>> Coming to them from the perspective "you are doing it wrong and there
>> is no
>> recourse for achieving what you need to do" strikes me as odd.
>
> I meant from the perspective of expecting the GC to close the file for
> you. If you manually run the destructor, such as from using delete, that
> wouldn't be a problem.

Or if you... close the file :o). OK, thanks for clarifying. -- Andrei




More information about the Digitalmars-d mailing list