Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-01-13 07:25:25


Dave wrote:
> Hello all,
>
> A direct call to shared_from_this() does not work in a constructor. Is
> there any way that I may obtain a shared_ptr to myself while under
> construction?

In short, no. You don't know which deleter to use. But can't you use a
static create function as explained here:

http://boost.org/libs/smart_ptr/sp_techniques.html#in_constructor


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