Boost logo

Boost Users :

From: Daniel James (daniel_james_at_[hidden])
Date: 2006-03-08 18:05:34


On 3/6/06, Peter Dimov <pdimov_at_[hidden]> wrote:
> Scott Meyers wrote:
> > They are documented not to throw, yet both call
> > intrusive_ptr_add_ref. How can it be that the top constructor above
> > may throw, but these constructors may not?
>
> You are right, this is a documentation bug (similarly for operator=). The
> "// never throws" annotations aren't present in the synopsis. Fixed in CVS,
> thanks for the report.

It might be a good idea to add a note about how intrusive_ptr_add_ref
is expected to behave if it does throw. It seems to be implied that
when an exception is thrown, it shouldn't change the reference count,
and should destroy the object if the reference count is zero, but it's
quite subtle.

Daniel


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net