auto classes and finalizers
Sean Kelly
sean at f4.ca
Mon Apr 10 09:30:49 PDT 2006
kris wrote:
>
> On the other hand, all these concerns would melt away if the GC were
> changed to not invoke the dtor (see related post). The beauty of that
> approach is that there's no additional keywords or compiler behaviour;
> only the GC is modified to remove the dtor call during a normal
> collection cycle. Invoking delete or raii just works as always, yet the
> invalid dtor state is eliminated. It also eliminates the need for a
> dispose() pattern, which would be nice ;-)
For what it's worth, I think this could be accomplished now (thogh I've
not tried it) as follows:
Object o = new MyObject;
gc_setFinalizer( o, null );
Sean
More information about the Digitalmars-d
mailing list