Boost logo

Boost :

From: E. Gladyshev (egladysh_at_[hidden])
Date: 2003-10-10 12:16:27


--- Douglas Gregor <gregod_at_[hidden]> wrote:
> On Friday 10 October 2003 01:53 am, E. Gladyshev wrote:
> > --- Douglas Gregor <gregod_at_[hidden]> wrote:
> > According 3.8.4 (IF WE ASSUME THAT 'new(obj)' is "reusing storage") when I
> > call char *p = new( (void*)&m.x ) char;
> >
> > I end lifetime of m.x,
>
> Agreed, because the storage associated with m.x has been reused. For
> reference, that's the last bullet of 3.8/1.
>

If you agree that lifetime of x is over it means
that an object can still be alive(?) while
some of his members are dead.
What if the dead member is object's heart. ;) (just kidding)

After we called char *p = new( (void*)&m.x ),
then the behavior of 'm.x.f()' is undefined
so the behavior of 'm' is undefined
so in fact, we ended lifetime of 'm'?

If it is true does't it mean that 'reusing'
storage of a member can be considerred as
'reusing' storage of the whole object?

Eugene

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


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