Boost logo

Boost :

Subject: Re: [boost] [Block Pointer] Review Request
From: Phil Bouchard (philippe_at_[hidden])
Date: 2011-05-02 15:32:42


On 5/2/2011 10:09 AM, Mathias Gaunard wrote:
>
> Order of instantiation is irrelevant outside of RAII management
> patterns, since an object may outlive its creator (that's the point).

If block A was instantiated first then block A is necessarily the parent
of block B.

> What do you mean by the block_ptr will be invalidated? The pointer will
> be set to zero?

Precisely.

> So that's something any user should be ready for, check block pointers
> are non-zero in destructors?

It's already done implicitly in the destruction of the block_ptrs.
Right before they'll be destroyed the pointer will still refer to the
deallocated memory block.

-Phil


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk