How to write a proper class destructor?

Jarrett Billingsley kb3ctd2 at yahoo.com
Fri Jan 26 05:40:11 PST 2007


"Frits van Bommel" <fvbommel at REMwOVExCAPSs.nl> wrote in message 
news:epcrvr$hen$1 at digitaldaemon.com...

> "auto" is for type inference.

No ;)

'auto' is the default (hidden) storage class for local variables in a 
function.  So the following declarations are equivalent:

int x;
auto int x;

'auto' is in the same family as 'static', 'const', and 'scope'.  'auto' does 
not do type inference.  Type inference is triggered when there is a storage 
class, but no type.  So these all trigger type inference:

auto x = 5;
static y = 10;
const z = 15;
scope f = new Foo();

'auto' just happens to be the most common of the bunch, and so you see it a 
lot more.  But it doesn't mean "infer the type."

> "auto" may still do automatic deletion when a type is also supplied, I'm 
> not sure, but if so that's just for backwards compatibility. Don't use it 
> for that in new code.

Nope. 




More information about the Digitalmars-d-learn mailing list