20 May
2013
20 May
'13
3:02 p.m.
On Fri, May 17, 2013 at 3:22 AM, Slava
boost::shared_from_raw(this); // necessary for weak_from_raw() to function properly this->child->parent = boost::weak_from_raw(this);
I reached what I needed, but I have some bad feeling about how it works. It does not look sane, boost::shared_from_raw(this) class is there only to produce the desired side effect.
You could just not use weak_from_raw at all. You can initialize your weak_ptr from the shared_ptr returned by shared_from_raw. -- Frank