How to write a proper class destructor?

Jonas Kivi satelliittipupu at yahoo.co.uk
Fri Jan 26 05:54:23 PST 2007


Frits van Bommel kirjoitti:
> Jonas Kivi wrote:
>> And about the scope keyword on a class member suggestion: What about 
>> the "auto" keyword. What's the difference between the auto and the 
>> scope keywords?
> 
> "scope" is for automatic deletion. "auto" is for type inference.
> "auto" used to also be for automatic deletion, but its dual purpose was 
> annoying, especially when you wanted to have both of its meanings apply 
> (which wasn't possible).
> "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.


Ahh, thanks for clearing that up. I changed all the auto-keywords in my 
own projects code to scope. There were some 50 of them. I'm not sure. It 
looked like it had some effect on my program, so maybe the auto keyword 
doesn't even work for it's old purpose anymore? Don't know. But thanks, 
now I only have my destructors unfunctional.


More information about the Digitalmars-d-learn mailing list