Hi all,
In the book I read it says:
"The destructor should only release resources that your object holds on to, and should not reference other objects. Note that if you have only managed references, you don't need to and should not implement a destructor; you want this only for handling unmanaged resources. Because there is some cost to having a destructor, you ought to implement this only on methods that require it (that is, methods that consume valuable unmanaged resources)."
Does this mean, I shouldn't use destructors If so, say I have a static member storing the number of current instances, incremented by the constructor, how do I decrement it when an object is destroyed
Is there any other way around this
Thanks,
aw