how to return shared_ptr to current object from inside the “this” object itself
问题 I have an instance of View class (instantiated somewhere in the Controller owning object using shared_ptr) class ViewController { protected: std::shared_ptr<View> view_; }; This view has also method "hitTest()" that should return this view's shared_ptr to the outside world class View { ... public: std::shared_ptr<UIView> hitTest(cocos2d::Vec2 point, cocos2d::Event * event) { ... }; How can I implement this method from inside the View? It should return this VC's shared_ptr to outside?