Created
August 5, 2013 17:44
-
-
Save zxmarcos/6157876 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 <iostream> | |
| #include <string> | |
| using namespace std; | |
| class hello { | |
| public: | |
| hello& message(string msg) { | |
| cout << msg; | |
| return *this; | |
| } | |
| }; | |
| class foo { | |
| hello attr; | |
| public: | |
| hello& getThis() { | |
| return attr; | |
| } | |
| }; | |
| int main() | |
| { | |
| foo a; | |
| a.getThis().message("Olá mundo!\n"); | |
| a.getThis().message("Olá mundo!").message(" mais legal ainda!\n"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment