Boost logo

Boost Users :

Subject: [Boost-users] smart_ptr/enable_shared_from_raw
From: Andreas Beisler (ebfx_at_[hidden])
Date: 2012-11-09 12:17:52


Hi,

it's known that calling shared_from_this() in a constructor doesn't
work. It seems that whenever this issue arises, people resort to
creating a factory that first constructs the object and then calls an
init function in which the user is free to call shared_from_this().

It seems though that there is a perfectly working enable_shared_from_raw
class in the trunk since a couple of years now that allows the developer
to call shared_from_raw(this) in a constructor.

Are there plans of merging this into a release sometime? If not, is it
safe to throw out the smart_ptr stuff of a release (I'm using 1.48.0
still) and replace it with the version from the trunk?

Thanks,
Andreas


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