Last active
November 11, 2018 04:39
-
-
Save isaac-weisberg/ed0ea3d7ef3512e64c3b40904f215b4e 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
| auto foo() { | |
| class Bar { | |
| public: | |
| int baz; | |
| }; | |
| Bar ret; | |
| ret.baz = 3; | |
| return ret; | |
| } | |
| void usage() { | |
| // Can not reference the returned value by anything BUT auto | |
| // however the compiler is absolutely aware of the returned | |
| // object's structure | |
| auto val = foo(); | |
| int baz = val.baz; // 3 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment