dangling pointer
dangling pointer
dangling pointer
- No tags were found...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
How to enable shared from thisIf we were to implement enable_shared_from_this manually in our class, itwould look like this:class window {// …boost::weak_ptr m_weak_this;window(){}public:boost::shared_ptr shared_from_this() {return boost::shared_ptr(m_weak_this);}static boost::shared_ptr create() {boost::shared_ptr shared_this(new window);shared_this->m_weak_this = shared_this;return shared_this;}};