Boost logo

Boost :

Subject: Re: [boost] deleting smart pointer
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-03-19 11:40:26


AMDG

On 03/19/2011 03:16 AM, pavel wrote:
> Steven wrote on Saturday, March 19, 2011 at 1:31:51:
>> "...In the first alternative (delete object), the value of the operand
>> of delete may be a null pointer
>> value, a pointer to a non-array object created by a previous
>> new-expression, or a pointer to a subobject (1.8)
>> representing a base class of such an object (Clause 10). If not, the
>> behavior is undefined."
> it looks like you are citing the old std (or i have a corrupted copy)
>

Actually, I got it from n3242 which is a recent C++0x draft.

> here is the full citation of 5.3.5.2 of ISO/IEC 14882:2003(E) which,
> i guess, you are referring to:
>
> "<snip>"
>
> feel free to prove me wrong

Okay. Let's do this a different way
(a little later in the section):

"In the first alternative (delete object), if the static type
of the operand is different from its dynamic type, the
static type shall be a base class of the operand’s
dynamic type and the static type shall have a virtual
destructor or the behavior is undefined."

In Christ,
Steven Watanabe


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