
27 Feb
2009
27 Feb
'09
1:21 p.m.
Hi Achilleas.
Could you explain why this should work?
The idea is this the following: An object is deleted if all the ptrs that point to it expired. Each ptr has an age. When a ptr releases an object, it checks if the object has any other ptrs with age older than the ptr. If not so, then it means the released ptr is the oldest one, and therefore the object should be deleted. I have updated the Boost Vault files with an example with better unit testing. It works, except when ownership of an object with cycles is transferred to a newer ptr.