
On 5/1/2011 3:05 PM, Mathias Gaunard wrote:
This is not what I meant. When you have a cycle, the order in which destructors are called cannot be specified.
Wrong because block_ptr knows in which order the memory blocks were instantiated, just as in a FIFO.
This makes it impossible to guarantee that the object held by a block_ptr won't have been destructed in the destructor of a class that has a block_ptr as a member.
I am not sure if I understand correctly what you are saying but block_ptr members to other classes will be invalidated if they point to an object that is currently being destructed. You can see an example in the 3rd test of the following file: https://svn.boost.org/svn/boost/sandbox/block_ptr/libs/smart_ptr/test/block_... -Phil