Created
January 21, 2017 15:37
-
-
Save melvyniandrag/f593eda072e7994c47fb4b1252773ed4 to your computer and use it in GitHub Desktop.
The destructor is called as described in the concrrency tutorial.
This file contains 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> | |
class BartoszMilewski{ | |
public: | |
BartoszMilewski(){ | |
greeting = "Hello"; | |
std::cout << greeting << std::endl; | |
} | |
~BartoszMilewski(){ | |
std::cout << greeting << std::endl; | |
} | |
std::string greeting; | |
}; | |
void takeRValue(BartoszMilewski && bm){ | |
bm.greeting = "Goodbye"; | |
} | |
int main(){ | |
takeRValue(BartoszMilewski()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment