Created
October 10, 2016 21:57
-
-
Save Kobzol/36358211c2927e9405be2fb6231b5366 to your computer and use it in GitHub Desktop.
wtf
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 <iostream> | |
| class A | |
| { | |
| public: | |
| void fn() & { | |
| std::cout << "A" << std::endl; | |
| } | |
| void fn() && { | |
| std::cout << "B" << std::endl; | |
| } | |
| }; | |
| A getA() | |
| { | |
| return A(); | |
| } | |
| int main(int argc, const char **argv) | |
| { | |
| A a; | |
| a.fn(); | |
| getA().fn(); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment