On 18 October 2011 18:41, Basile Starynkevitch wrote: > > However, I don't know very well auto_ptr. Could you explain to use how do > they deal with > *circular* memory references.... (perhaps by taking as examples code inside > GCC). > My feeling is that auto_ptr is not able to deal with them, but I'll be > delighted to be > proven wrong.
Noone except you mentioned auto_ptr. Something like shared_ptr is a better choice in some cases, and its companion weak_ptr can be used to break cycles.