auto classes and finalizers

Mike Capp mike.capp at gmail.com
Mon Apr 10 05:46:34 PDT 2006


In article <e1dak2$21d9$1 at digitaldaemon.com>, Bruno Medeiros says...
>
>Protection attributes and casts add usefulness (not gonna detail why).

The usefulness of protection attributes lies solely in preventing you from
misusing something. Same with auto and dtors. If a class needs a dtor, leaving
it to the GC qualifies as misuse in my view.

>Forcing all classes with destructors to be auto classes, on the other 
>hand, severily limits the usage of such classes. An auto class can not 
>be a global, static, field, inout and out parameter. It must be bound to 
>a function, and *cannot be a part of another data structure*. This 
>latter restriction, as is, is unacceptable, no?

Agreed; IIRC, auto members of auto classes were part of my original suggestion,
and I think the dtors-for-autos-only restriction would quickly force this
problem out into the open.

It may be that we're agreeing on the destination and only differing on how to
get there.

cheers
Mike





More information about the Digitalmars-d mailing list