
On 02/05/2011 02:20, Phil Bouchard wrote:
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.
Order of instantiation is irrelevant outside of RAII management patterns, since an object may outlive its creator (that's the point).
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_...
What do you mean by the block_ptr will be invalidated? The pointer will be set to zero? So that's something any user should be ready for, check block pointers are non-zero in destructors?