Last active
August 29, 2015 13:56
-
-
Save usagi/9188550 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "enable_shared_from_this_wrap.hxx" | |
| class A: public enable_shared_from_this_wrap<A> | |
| { | |
| public: | |
| void fa(){} | |
| }; | |
| class B: public enable_shared_from_this_wrap<B, A>{ | |
| public: | |
| void fb(){} | |
| }; | |
| int main() | |
| { | |
| auto b = std::make_shared<B>(); | |
| b->shared_from_this()->fa(); | |
| b->shared_from_this()->fb(); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://blog.wonderrabbitproject.net/2014/02/c-pointer-stdenablefromthis.html