Boost logo

Boost :

From: Geoff Carlton (gcarlton_at_[hidden])
Date: 2005-06-27 18:43:42


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk