> class foo
> {
> private ~this()
> {
> }
>
> public kill()
> {
> // call any specific code you want here
> delete this;
> }
> }
>
> Then use foo.kill() instead of delete foo. Ugly, but works, I think.
I don't think it does work. If you have a "scope" variable, for
example, the compiler won't call "kill" when deleting the object.
-- Brian