Boost logo

Boost :

From: Daniel Frey (d.frey_at_[hidden])
Date: 2008-03-26 08:00:43


On Wed, 2008-03-26 at 07:38 -0400, Frank Mori Hess wrote:
> On Wednesday 26 March 2008 02:55, Daniel Frey wrote:
> > Hello again,
> >
> > does shared_from_this() also guarantee that it never throws?
>
> No, it can throw bad_weak_ptr.

<http://boost.org/libs/smart_ptr/smart_ptr.htm> states that only
std::bad_alloc is thrown - if anything is thrown at all. Am I misreading
that?

And reading the documentation for weak_ptr, it's not clear to me when a
bad_weak_ptr exception is thrown at all. All weak_ptr functions are
documented to never throw.

Regards, Daniel

BTW: In the introduction, it says that there are five smart pointer
classes, then it lists six... :)


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