
27 Jun
2005
27 Jun
'05
11:43 p.m.
Olaf Krzikalla wrote:
Hi,
Another disadvantage of the destructor calling clear() is that it prevents the node class from having a private destructor. Objects may need to be deleted via a manager class, however the destructor's clear() will cause a compile error in this situation.
This part I didn't fully understand. Can you give a little example?
Sorry, I was a bit confused here. A previous implementation I have seen deleted the nodes on clear(), and suffered from the problems I outlined above. I had assumed that this implementation did the same, but now I have double checked I see that instead it just unlinks the nodes and lets them go free. That makes more sense. Geoff