Last active
May 17, 2017 05:56
-
-
Save ktnyt/95c274aef336936a1810326073821d30 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 <memory> | |
struct Human { std::shared_ptr<Human> lover; }; | |
struct Mika : public Human {}; | |
struct Miria : public Human {}; | |
int main() { | |
auto mika = std::make_shared<Mika>(); | |
auto miria = std::make_shared<Miria>(); | |
/* 永遠の愛 */ | |
mika->lover = miria; | |
miria->lover = mika; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment