How to write a proper class destructor?

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Fri Jan 26 05:55:56 PST 2007


Jarrett Billingsley wrote:
> "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."

Right, forgot about all that for a moment[1]. However, that is how it 
*should* be. And if you follow those rules, it works just fine, so...


[1] Which is weird, since the code I'm currently working on uses 'const' 
for type inference wherever possible ;)


More information about the Digitalmars-d-learn mailing list