What's the use case of clear?

Steven Schveighoffer schveiguy at yahoo.com
Tue Aug 10 11:28:05 PDT 2010


On Tue, 10 Aug 2010 14:22:23 -0400, Lutger <lutger.blijdestijn at gmail.com>  
wrote:

> Again you are right, this only works for non-gc owned resources. Frankly  
> at this
> point I wonder how to even begin use class destructors for anything  
> interesting,
> especially in the wake of clear(). Did you ever write one?

No, I usually avoid them, simply because they are not much use :)  It's  
inevitably the place we all end up after thinking about the rules.

> The spec says that this restriction does not apply when the users calls  
> delete
> since it isn't collecting then (also applies to clear), but I don't  
> think there
> is any way to detect that.

Yeah, I posted an idea that maybe can fix that.


More information about the Digitalmars-d mailing list