Boost logo

Boost :

From: William E. Kempf (wekempf_at_[hidden])
Date: 2003-01-07 14:12:38


(Sorry for any line break problems... more normal mail system is down because my Linux box has crashed, and the temporary access I have to e-mail is a cheap webmail interface for which I have little control over the formatting.)

> From: David Abrahams <dave_at_[hidden]>
> "Peter Dimov" <pdimov_at_[hidden]> writes:
>
> > It's true that, in general, there is no safe way to break the cycle; x1 may
> > keep a raw pointer to x2, or it might be a X invariant that X::p is
> > non-empty, causing ~X to fail. This is why the final decision to break the
> > cycles should be left to the user, and the collector should not
> > automatically reclaim memory. Still, most reasonable classes would be
> > collect-friendly.
>
> Isn't the biggest problem one of system design? How does the user
> write the cycle-breaking code which does different things based on the
> dynamic type of the objects being referenced?

That's basically the question I had, but much better worded. With out a solution for this, I think it's better to just call the destructors and leave it up to the user to write "garbage collector safe destructors", which is the norm any way.

William E. Kempf
wekempf_at_[hidden]


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