Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-02-24 19:34:45


"Philippe A. Bouchard" <philippeb_at_[hidden]> writes:

>> And if the object's constructor throws an exception, what then?
>
> I am not familiar with exceptions that much, but calling implicitly
> the object's destructor will not affect its construction if the user
> does not forget to call its constructor. Doesn't it?

look:

        {
            aligned_storage<T>::type storage;

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

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

-- 
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