From: E. Gladyshev (egladysh_at_[hidden])
Date: 2003-10-10 02:52:46
--- 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.
> > so I end the storage duration of a member subobject.
> Here I disagree. The lifetime of the member subobject has ended, but I don't
> see how this impacts the storage duration of the member subobject. You
> > 1.7.1
> > "An object has a storage duration which influences its lifetime"
It says an object *has* storage duration.
My interpretation was that by "reusing" the storage
you end object's storage duration by ending its storage
duration you end the object's lifetime.
By ending the storage duration of an subobject (by reusing it)
you effectively ending the storage duration of its complete
It is becoming funny, is not it? :) Kinda chicken and egg problem.
I think we can never reach a consensus till the standard
defines "reusing storage".
> Also, some anecdotal information (far from proof-worthy, but helps show
> intent): 3.7/4 explicitly states that the lifetime of a reference is its
> storage duration, but we don't see any such statement for other types.
Yeah, it is interesting.
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk