TDPL: Manual invocation of destructor
awishformore
awishformore at nospam.plz
Mon Aug 9 13:57:54 PDT 2010
On 09/08/2010 22:52, Andrei Alexandrescu wrote:
> awishformore wrote:
>> Quite frankly, I can't imagine any situation where I would ever want
>> to use the clear the way you currently intend to implement it, and if
>> you're unclear, you will probably agree that you don't really see a
>> good way to implement it as things stand.
>>
>> Rather than removing delete and implementing a completely useless
>> clear, I would like to see an improved version of the GC that can
>> correctly handle delete. Maybe you are approaching the issue from the
>> wrong perspective.
>
> If it's not easy to decide between two alternatives, choosing a third
> that's worse than either is probably not a good idea.
>
> Regarding "correct" handling of delete by the GC - what does that mean?
> Once you define that, I'll be glad to put that behavior in clear() :o).
>
>
> Andrei
In the sense of the word, I want "delete" to delete the object.
That means:
- all references to the object are invalid
- the memory is freed
As has been argued before, this obviously wouldn't belong in the SafeD
subset of the language. As far the SafeD subset, there shouldn't be any
such instrument at all.
/Max
More information about the Digitalmars-d
mailing list