Accomplishing boost::shared_from_this() in constructor via boost::shared_from_raw(this)
- by Kyle
Googling and poking around the boost code, it appears that it's now possible to construct a shared_ptr to this in a constructor, by inheriting from enable_shared_from_raw and calling shared_from_raw(this)
Is there any documentation or examples of this? I'm finding nothing with google.
Why am I not finding any useful buzz on this on google? I would have thought using shared_from_this in a constructor would be a hot/desirable item.
Should I be inheriting from both enable_shared_from_raw and enable_shared_from_this, and restricting my usage of enable_shared_from_raw when I have to?
If so, why? Is there a performance hit with shared_from_raw?