Boost logo

Boost :

Subject: Re: [boost] [Block Pointer] Review Request
From: Phil Bouchard (philippe_at_[hidden])
Date: 2011-05-01 20:20:13

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:


Boost list run by bdawes at, gregod at, cpdaniel at, john at