Boost logo

Boost :

From: brangdon_at_[hidden]
Date: 2002-03-11 15:33:18


In-Reply-To: <B59D39CC-3457-11D6-8200-003065D18932_at_[hidden]>
On Sun, 10 Mar 2002 13:50:36 -0500 Howard Hinnant (hinnant_at_[hidden])
wrote:
> Note that the base class got destructed first. During the period that
> Derived was busy relocating its members, it was operating with a
> destructed Base.

This isn't quite right. Although the source Base is destructed, the
destination Base has now been constructed. And it is the destination
Derived which is busy relocating the members. It need not and should not
invoke code of the source Derived. It can talk to its own Base, if it
wishes.

> In a nutshell, I find changing the order of destruction of base classes
> too scary. Therefore I believe that Derived will have to ask Base to
> move construct itself, leaving behind a valid Base that Derived can
> communicate with during its own destruction, after which ~Base() would
> run.

I sympathise. However, although during a move the source Base is valid, it
is crippled by the lack of resources. I think asking it to do stuff in its
crippled state is almost as scary.

-- Dave Harris


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