|
Boost : |
From: Yuval Ronen (ronen_yuval_at_[hidden])
Date: 2005-12-07 11:20:13
Peter Dimov wrote:
> The reference adds a strong exception safety guarantee. If the shared_ptr
> constructor fails, the source auto_ptr is left intact. Pass by value would
> have already zeroed out the source.
>
> If you want to achieve the equivalent of pass by value, you can use an
> explicit .release().
>
> This warning would actually be an error on a stricter compiler.
>
> One happy day the compiler writers will bring us the rvalue reference, the
> constructor will take auto_ptr &&, and all will be well with the world. :-)
Does that mean that on a stricter compiler, when passing a temporary
auto_ptr, I *have* to use the '.release()' way, and *can't* get the
strong exception guarantee?
Thanks a lot to both of you Peter and Howard for your help.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk