From: "William E. Kempf" <[EMAIL PROTECTED]> > > No, the user would not be expected to do any bookkeeping. He would only need > > to call find_unreachable_objects() that would return a list of the > > unreachable objects, and then, optionally, call break_cycles() with that > > list as an argument. Or something like that. :-) > > And how would break_cycles() accomplish its task with out book keeping?
The information that is needed to break the cycles (a list of unreachable shared_ptr instances) is generated by find_unreachable_objects for free, since to determine object reachability, objects are scanned for shared_ptr subobjects. When those shared_ptrs are reset() by break_cycles(), all unreachable objects will be freed, their destructors will run, and any weak_ptrs to those objects will correctly expire. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost