Boost logo

Boost :

Subject: Re: [boost] [interprocess] default constructors
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2008-11-30 07:27:24


Mathias Gaunard wrote:
> If you implement move as swap, there is no problem at all.
> You could still implement move as transfer, leaving the moved-from
> object in some state where only destruction and assignment are valid;
> there is no need to make that state reachable from public
> default-construction.

I don't think move should be implemented as swap, because the resource
(shared memory) is still there floating around:

//other_shm poits now to shm resources?
shm = move(other_shm);

I think move should be implemented as containers implement it (something
similar to swap + clear):

//other_shm will be in default-constructed state
shm = move(other_shm)

Regards,

Ion


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