Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-03-05 17:18:50


"Andrei Alexandrescu" <andrewalex_at_[hidden]> writes:

> "David Abrahams" <dave_at_[hidden]> wrote in message
> news:uznokbhwx.fsf_at_boost-consulting.com...
>> Once again, the case was:
>>
>> {
>> aligned_storage<T>::type storage;
>>
>> new ((void*)&storage) T(x, y, z); // throws
>>
>> // ~aligned_storage<T>() destroys non-existent T
>> }
>
> You mean "~aligned_storage<T>::type() destroys non-existent T"?

Actually, I meant this:

        {
            aligned_storage<T> storage;

            new ((void*)&storage.bytes) T(x, y, z); // throws

            // ~aligned_storage<T>() destroys non-existent T
        }

Phillipe was proposing to give ~aligned_storage<T> responsibility for
destroying the contained object, which doesn't work, no matter how
you (mis)spell it ;-)

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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