Chuck Messenger wrote:
[snip]
In general, the abstraction is: you have a group of intra-referential objects. When any of the group is constructed, they are all constructed (so that the master count is temporarily > 1), and the master count is reset to 1. When the master count goes to 0, the group is destructed. Hence, the group only remains alive as long as there are any external references (and as long as the intra-group references remain static).

Could a standard smart pointer be designed to encapsulate this abstraction? Hmmm....
Just FYI, this "abstraction" is the basic idea behind recoverying
cycles in:

http://www.cs.kent.ac.uk/people/staff/rej/cgi-bin/searchbib?pattern=Cyclic+reference+counting+with+lazy+mark-scan.

Chrisopher's altorithm:

http://www.cs.kent.ac.uk/people/staff/rej/cgi-bin/searchbib?pattern=Christopher+Reference+count+garbage+collection

is basically the same, except the "group" is the whole heap.  Christopher's
is the basis of Colvin's cyclic_ptr:

http://groups.yahoo.com/group/boost/files/smart_pointers/cyclic_ptr/

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to